Upgrade Your JavaScript Promises with .any()
Vložit
- čas přidán 9. 07. 2024
- In this JavaScript Tuesday, we look at .any(), a promise method added in EcmaScript 2021 (ES12). It is a combination of .all() and .race()... it takes a iterable of promises and will finish when the first one fulfills - like .race, the first one, like .all, fulfilled only. An absolute must for when you have promises that need redundancy or speed! Make sure to hit subscribe and never miss a JavaScript Tuesday release!
Code: github.com/robertbunch/es-next
History of ECMAScript/JavaScript (long) - • Visual Timeline of Jav...
History of ECMAScript/JavaScript (shorter) - • Visual Timeline of Jav...
ES playlist: • EcmaScript Updates
ES9 - Promise.finally(): • JavaScript Promises - ...
ES11 - Promise.allSettled(): • JavaScript Promises Re...
0:00 - Introduction
1:25 - The Docs
3:24 - Code example
4:26 - Contrast with .all()
5:03 - Contrast with .race()
6:00 - .any() in action
7:18 - Use Cases
9:00 - Final doc notes - Věda a technologie
This was a good watch. Thanks!
Thanks for watching and commenting! These promise methods are great and really help understand the basics of promises better, but really add some depth what we can do with them.
Love the content bro
Love from india 🇮🇳
I love India :) Thanks for watching, commenting, and coding! Keep at it.
Merci pour cette vidéo :)
Merci pour le merci :)