Promises have just gotten nicer! (withResolvers)

Поделиться
HTML-код
  • Опубликовано: 21 ноя 2024

Комментарии • 14

  • @RyanThickett
    @RyanThickett 5 месяцев назад +13

    Honestly I just find the async await pattern so much cleaner anyway, stringing together .then().catch().error() etc... always looked super ugly to me, whereas having a function you can just await and then deal with however you want to after is clean.

    • @adolfomartin5456
      @adolfomartin5456 5 месяцев назад +1

      I agree with you. Sometimes we have to use new Promise ... but in at the moment I'm sure I've forgotten this video.

    • @SoftwareDeveloperDiaries
      @SoftwareDeveloperDiaries  5 месяцев назад

      I also agree, async await is always better :)

    • @sirajabbas5372
      @sirajabbas5372 5 месяцев назад

      For me also async await is much cleaner and readable. However this is handly where the situations we forced to use promises.

  • @chris94kennedy
    @chris94kennedy 5 месяцев назад +5

    pretty cool, some nice sugar. Also prevents the antipattern of an async anon function in a Promise constructor

  • @sergiyrudenko905
    @sergiyrudenko905 5 месяцев назад

    Thank you!

  • @axel_huth
    @axel_huth 5 месяцев назад

    👍😎👍

  •  5 месяцев назад

    Awesome

  • @harrypotil860
    @harrypotil860 5 месяцев назад

    You promised that you would make a vedio on how Discord would have avoided Cassandra beforehand

  • @mimshins
    @mimshins 5 месяцев назад

    Why not just return Promise.resolve(data) or Promise.reject(error)?

  • @sergeyagronov9650
    @sergeyagronov9650 5 месяцев назад

    great video :)

  • @Finn-jp6pn
    @Finn-jp6pn 5 месяцев назад

    Can't we always use async keyword to implicitly return a promise instead of explicitly returning a new promise? 🤔