DEV Community

[Comment from a deleted post]
Collapse
 
jacobmgevans profile image
Jacob Evans

The synchronous behavior, the execution pausing is purposeful with await. If you want parallel behavior use Promise.all([first, second, third]) or even Promise.allSettled([first, second, third]), pass in the awaited variables.

Collapse
 
seraphicrav profile image
Ravaka Razafimanantsoa

In a video I watch from the NodeJS conventions, there is a trap.
Actually, promise.all works well in case of everything being successful.
If one promise fails, the other promises continue running and if they fail too, boom!

This is why all settled is coming I guess.

Collapse
 
jacobmgevans profile image
Jacob Evans

Yeah, it's why it added it to my comment. Thanks for elaborating further though 🙂