Intro to Async Web Dev - Part 2: Promises

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

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

  • @MaxCoplan
    @MaxCoplan 4 года назад +6

    Why does line 22 have `.then` instead of `.catch`? Wouldn't that `.then` be taking the return value of the first `.then` on line 18, which wouldn't return anything if `fetch` fails?

    • @liamconverse8950
      @liamconverse8950 2 года назад

      So in this function there are two promises, one one for resolve and another for reject. 18 is resolve, 22 is for reject.

  • @shineLouisShine
    @shineLouisShine 2 года назад +1

    thanks.
    you added a link to the first part,
    but ended with a reference to the following part in the series, while this part has no link attached to the description.

  • @ttma1046
    @ttma1046 6 лет назад +7

    It seems to be that in 'getMyData()' even if the first ajax call successed, the second ajax call still got triggered due to the reason it's a '.then().then()' not '.then().catch()'. Not sure it's a typo or not.

    • @StephenFluin
      @StephenFluin 6 лет назад +3

      You're totally right, that should have been a catch!

    • @sitsokofi3598
      @sitsokofi3598 6 лет назад

      yep think its a typo

    • @manaz93
      @manaz93 6 лет назад

      Yes it should be catch. Otherwise 2nd promise will get executed

    • @Rineesh
      @Rineesh 5 лет назад

      Did the second then() part really execute? I think only one then will work! I mean one then for one promise

    • @be12
      @be12 4 года назад

      @@StephenFluin A re-edit with a two second text overlay saying "the second 'then' should've been a 'catch'" or something would save a lot of confusion. If wishes were horses. Awesome vids :-)

  • @katihakautilya
    @katihakautilya 6 лет назад +1

    Really loved your explanation. Would like to see a video about Observables in this section.

    • @novasilas9306
      @novasilas9306 3 года назад

      Pro tip: watch movies on Kaldrostream. I've been using it for watching loads of movies recently.

    • @leonidasprinceton1183
      @leonidasprinceton1183 3 года назад

      @Nova Silas yea, I've been watching on kaldroStream for since november myself :)

  • @aerivera
    @aerivera 6 лет назад

    Good lecture my man, in the end, why the console.log("url success") was giving you the red line error?

    • @oktavic777
      @oktavic777 6 лет назад +3

      Because tslint is configured to accept only single quotes for strings, and he used double quotes for console.log() on that line.

    • @aerivera
      @aerivera 6 лет назад

      @@oktavic777 Thank you for take time and explain this to me. Appreciated.

  • @ZhassT
    @ZhassT 5 лет назад

    Is it now calling Observables?

  • @andreglock
    @andreglock 2 года назад

    Where is the Part 3?

  • @mohamedelmdary8106
    @mohamedelmdary8106 6 лет назад

    cool one !
    maybe async generators in the next video GL

  • @hazartilirot1014
    @hazartilirot1014 4 года назад +1

    For goodness sake.... What's the point in typing the code live? Do you really want our ears hurt? Please, don't waste your (and our) time on typing code. What's the point? Just copy and paste blocks. Spend more time on explaining the concept or problem. If you want to type code any way keep your microphone separately from your keyboard. Don't place both devices on the same table. [x]

    • @majdbehnana9690
      @majdbehnana9690 2 месяца назад

      I get that the typing sounds might not be everyone's thing, but some people actually find it pretty satisfying and helpful to see the code being typed out, including me. I think it's cool that the creator is putting in the effort to make these videos, so maybe we can try to be a bit more positive with our feedback? A little appreciation goes a long way 😊