Hello I\'m new to Javascript and APIs.
But I have an excersise where I should get Data from.
https://swapi.co/api/planets/
The problem is that it doe
I had similar needs so I wrote a library called fetch-paginate - here's an example: https://codepen.io/AndersDJohnson/pen/Jqadoz
fetchPaginate.default("https://swapi.co/api/planets", {
items: page => page.results,
params: true
})
.then(res => {
res.data.forEach(planet => {
const newPlanet = new Planet(planet);
this.planets.push(newPlanet);
})
})
You can get it here: https://unpkg.com/fetch-paginate@3.0.1/bundle.js