144
rated 0 times
[
148]
[
4]
/ answers: 1 / hits: 82280
/ 8 Years ago, mon, december 5, 2016, 12:00:00
I want to get an api and after that call another one. Is it wisely using a code like this in javascript?
fetch(url, {
method: 'get',
}).then(function(response) {
response.json().then(function(data) {
fetch(anotherUrl).then(function(response) {
return response.json();
}).catch(function() {
console.log(Booo);
});
});
})
.catch(function(error) {
console.log('Request failed', error)
});
More From » promise