I just read an Article related to promise and was unable to comprehend how we can do multiple API call using Axios via Promise.all
So consider there are 3 URL, lets call it something like this
let URL1 = "https://www.something.com"
let URL2 = "https://www.something1.com"
let URL3 = "https://www.something2.com"
And an array in which we will store Value
let promiseArray = []
Now, I want to run this in parallel (Promise.all
), but I am unable to figure our how will we do it? Because axios have a promise in itself (or at-least that's how I have used it).
axios.get(URL).then((response) => {
}).catch((error) => {
})
Question: Can someone please tell me how we can we send multiple request using promise.all and axios