Upgrade Your JavaScript Promises with .any()

Sdílet
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

Komentáře • 6

  • @ayoubalfurjani4531
    @ayoubalfurjani4531 Před 3 měsíci +1

    This was a good watch. Thanks!

    • @robertbunch-dev
      @robertbunch-dev  Před 3 měsíci +1

      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.

  • @ankitdas2197
    @ankitdas2197 Před 3 měsíci +1

    Love the content bro
    Love from india 🇮🇳

    • @robertbunch-dev
      @robertbunch-dev  Před 3 měsíci

      I love India :) Thanks for watching, commenting, and coding! Keep at it.

  • @davideugene7911
    @davideugene7911 Před 3 měsíci +1

    Merci pour cette vidéo :)