DEV Community

Cover image for The Power of Javascript Promise.all()

The Power of Javascript Promise.all()

Geoffrey Bourne on February 02, 2021

This post is not about Promises, async/await, or the single-threaded nature of Javascript. If you want to know about these topics, go here, here, o...
Collapse
 
leandroandrade profile image
Leandro Andrade

Hi! Thanks for your post. In your solution, think about use Promise.allsettled instead of Promise.all.

Promise.allsettled allow you handle errors if some requests return it.

Collapse
 
gbourne profile image
Geoffrey Bourne

Good one. Promise.allSettled is might be better in some circumstances to handle rejected Promises.