I need to make a bunch of API calls and combine their data finally like this
axios.all([
axios.get('https://api.github.com/users/mapbox'),
axios.get('https://api.github.com/users/phantomjs')
])
.then(responseArr => {
//this will be executed only when all requests are complete
console.log('Date created: ', responseArr[0].data.created_at);
console.log('Date created: ', responseArr[1].data.created_at);
});
But I also want to use the data received in one API in the other API call. Kind of like this
data = axios.get('https://api.github.com/users/mapbox'),
axios.get('https://api.github.com/users/'+data.user);
How do I use this for like 5 API calls?
awaitor nesting.then()as shown here.