anArray
.reduce(
(chain, x) => chain.then(() => networkCall(x)),
Promise.resolve()
)
.then(() => console.log('all done'))
.catch(() => console.error('something went wrong'))
Created
April 16, 2021 05:03
-
-
Save OleksiyRudenko/667713759899e318f5b3af8dacd24c7e to your computer and use it in GitHub Desktop.
Promise Patterns
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment