🔰chaining Promises
JS ⟩ async ⟩ Promise ⟩ chaining
Promise.inSeries() - get values from Promise chain of arbitrary length sequentially.
// chaining Promises
fetch(url) // `Response` Promise
.then(response => response.json()) // `JSON` Promise
.then(json => parseJSON()) // fictional `Profile` Promise
.then(profile => displayProfile()) // (end of Promise chain)
.catch(error => handle(error)); // error handlingLast updated
Was this helpful?