I was trying to use promise.all to do multiple api calls but for some reason it it throwing the following error
TypeError: # is not iterable
My Promise is fairly simple (this is probably the second time I am using Promise.all)
componentWillMount() {
const id = this.props.location.pathname
let axiosHome = axios.get('/home')
let axiosUserData = axios.get("/profile/" + id)
Promise.all(axiosHome, axiosUserData).then(response => {
console.log(response)
}).catch(error => {
console.log(error)
})
}
Question: Any idea why I could be getting this error? Also, can someone also explain when is that we use resolve keyword with promise?