JavaScript Promise race method
ฝัง
- เผยแพร่เมื่อ 6 ก.ย. 2024
- Similar to the JavaScript Promise.all( ) syntax, the Promise.race( ) method allows you to provide a series of Promises and only work with the result of the first one to Resolve.
Code GIST: gist.github.co...
Basic Promise video: • JavaScript ES6 Promise...
setTimeout video: • JavaScript Timers - se...
Promise.all( ) video: • JavaScript Promises al...
MDN Promise.race( ) reference page: developer.mozi...
The man, the legend, the Steve Griffith teaching style. Simply thank you.
Thank you for the lesson, mr. Griffith
I have never heard such nice explanation before this moment, Steve, I owe you a like and subscription.
I know it is pretty off topic but do anyone know a good place to watch newly released series online?
@Ace Derrick i dunno lately I have been using Flixportal. just search on google for it :P -uriah
@Uriah Hunter thanks, I went there and it seems like a nice service :D Appreciate it!!
@Ace Derrick You are welcome xD
The best Promise.race explanation I have ever met. Thanks!
Wow, so cool. Shot and sweet, thank you for sharing!
thanks a lot , I wish i could learn on site from you
Amazing video. Explained nicely. Thank you. It helped me a lot.
The way you explain is both very interesting and understandable. You are the only one who I listen to with a pleasure and without getting bored!
That's a fantastic motivation for me! Thank you for your videos, Steve!
P.S. What's the name of your dog? :))
Roxy and Rane are my two dogs.
i finally have idea what promises..are thanks
Clear explanation. In what kind of situation would you use this method?
Usually when you are getting data from two sources but only want the first one that comes back and dont care which one comes back first.
In real world examples of race is catch-reject is used or not?
Catch should be used for every promise.
So Steve, basically that means if you do a race with some promises and one of them fails first than the other good ones you will always get an error result? You have to handle that into your code in a different way or is there a way to discard failed promises?
Yes, the catch will be triggered by a critical failure like no network connection or a syntax error in your code. However, if you have an error of that magnitude then nothing is going to run anyway.