Great article. In addition to this, you can also run multiple promises and only continue once they are all complete using Promise.all. This is great way to, e.g. fetch data using two different requests, and then combine them once both requests complete.
Thank you for reading my article and your valuable feedback. As per your suggestion, I have updated this article by adding a new section "Multiple Promises in Parallel".
Very excited to announce that we have reached 1K followers in our community. We couldn't have done it without your support and engagement. We want to thank each and every one of you for being a part of our adventure..
We look forward to continuing to grow together & providing even more value to our community.
This is a great blog. I really loved the way promises has been explained with in-depth knowledge. More over the solution of the probelms mentioned made it even better. Keep up the good work.
It maybe just my interpretation of your words, but I could not see the difference between Promise.any() and Promise.race() from the above explanations.
Hello @anthonycroft Sorry for the confusions. I will take care of it moving forward.
Let me clear it for you..
Promise.race is settled when any of the promises is settled even if they are fulfilled or rejected. On the otherside, Promise.any is settled when any of the promises is fulfilled or if all of them are rejected, it will be rejected with an AggregateError.
Great article. In addition to this, you can also run multiple promises and only continue once they are all complete using
Promise.all
. This is great way to, e.g. fetch data using two different requests, and then combine them once both requests complete.Thank you for reading my article and your valuable feedback. As per your suggestion, I have updated this article by adding a new section "Multiple Promises in Parallel".
A great addition - I've only ever had to use
all
and occasionallyany
, so didn't know aboutrace
andallSettled
until reading it - thanks!You're welcome..
Excellent post! A lot of this translates into helpful insight when writing async/await functions, which are themselves based on promises!
developer.mozilla.org/en-US/docs/W...
Thanks for reading and feedback..
Ok, why are you giving a code with pictures?
For better representation of my articles. Moving forward, I will add source code as well..
Thank you for valuable feedback. I appreciate it..
Very excited to announce that we have reached 1K followers in our community. We couldn't have done it without your support and engagement. We want to thank each and every one of you for being a part of our adventure..
We look forward to continuing to grow together & providing even more value to our community.
Happy coding!!!
Thanks for the article! What program are you using for generating such cool code snippets and GIF animations?
Thank you for your valuable feedback.
I use these tools:
Miro - For diagrams
Canva - For GIF animations
Ray.so Image of code snippets
thanks
You're welcome..
wow, the great present article
Thank you..
This is a great blog. I really loved the way promises has been explained with in-depth knowledge. More over the solution of the probelms mentioned made it even better. Keep up the good work.
Thank you Aditya for your valuable feedback..
Thank you for share.
You're welcome. I am glad you found it useful read..
was a great article, made my day
Thank you for your feedback
This is not all about promises, there are much more, I suggest a book by Nicholas C. Zakas
Thank you boss. I appreciate your valuable feedback..
Thanks great article
Thank you Amir, for reading and feedback..
Wow! This is really cool, i feel i can use this really well!
Go for it. Thank you @grey41 for your feedback..
This article is great, though I have never have reason to use Promise.setttled but I find it very good
I’m glad you found it helpful. Thank you 🙏 for reading
Joining on 12/22/22 be like OFF BY ONLY ONE NUMBER NOOOOOOOOO
Hahaha, but we're both here now and that's what matters..
Wow, Thanks for writing this Great Article. I really learn a lot
Glad you found it helpful. Thanking you for reading and your valuable feedback..
Great article, great examples
Thank you 🙏 for your valuable feedback..
Great aticle
I’m glad you found it helpful. Thank you boss for your vaunted feedback
Great blog
Thank you bro for your valuable feedback.
Great article! Saving it to study later because i still struggle when working with promises. Thank u!
Thank you for your feedback. Glad to hear that you found it useful. Best of luck in your programming journey..
Fantastic explanation. May I use the link to your article in mine?
Thank you for your feedback. Yes you can.. 🙏
It maybe just my interpretation of your words, but I could not see the difference between Promise.any() and Promise.race() from the above explanations.
Hello @anthonycroft
Sorry for the confusions. I will take care of it moving forward.
Let me clear it for you..
Promise.race
is settled when any of the promises is settled even if they arefulfilled
orrejected
.On the otherside,
Promise.any
is settled when any of the promises is fulfilled or if all of them are rejected, it will be rejected with an AggregateError.Thanks
You're welcome
Thank you so much bro