I have two api calls in promise ,so i have used promise.all and it is working fine.
Now i have one api call is enough to get the results but still i am using promise.all it is working fine.
I try to use promise instead of promise.all(here i used one api call )
my code here :
Promise.all([getCall()])
.then(res => {
if (res[0].errorObject) {
props.Error(res[0]);
} else {
<!----code here--->
}
})
.catch(err => {
console.log(err);
});
2
Answers
You can using fetch()
like this for example :