DEV Community

Cover image for Methods of Promise: .all(), .any() , .finally(), .race()

Methods of Promise: .all(), .any() , .finally(), .race()

Swarnali Roy on August 07, 2021

In the previous posts of this series, I've shown the resolve and reject methods of a Promise and also how to retrieve data from a Promise using Pro...
Collapse
 
ridvanaltun profile image
Ridvan Altun •

You not mentioned Promise.race().

Collapse
 
swarnaliroy94 profile image
Swarnali Roy •

Now it's added. :)

Collapse
 
swarnaliroy94 profile image
Swarnali Roy •

Yes, I didn't mention that, I've mentioned these three because these are used most commonly. There are other methods as well , will mention them later.

Collapse
 
adam_cyclones profile image
Adam Crockett 🌀 •
Collapse
 
swarnaliroy94 profile image
Swarnali Roy •

Yeah.. thank you.. will include that also later

Collapse
 
websilvercraft profile image
websilvercraft •

I'm use Promise.race to add timeouts to fetch calls, to make sure the calls don't remain hanged up connections open.

Collapse
 
akashsarkar profile image
Akash Sarkar •

This is a good one. Thanks for sharing.

Collapse
 
swarnaliroy94 profile image
Swarnali Roy •

You're welcome. Keep following for more posts...

Collapse
 
dirname profile image
lexxo2002 •

More

Collapse
 
jaymees profile image
Jaymees •

Not mentioned Promise.allSettled()

Collapse
 
kishoreandra profile image
kishoreandra •

Nice explaination :) Thank you for putting the post

Collapse
 
swarnaliroy94 profile image
Swarnali Roy •

My pleasure.. Keep following for more posts..

Collapse
 
laxmichand profile image
Laxmi Chandra Dhuvare •

what happen with other promise in race condition ?