Effective Spinners with the Promise finally Method

Поделиться
HTML-код
  • Опубликовано: 10 сен 2024
  • This tutorial shows some best practices on how to work with Spinners and Loaders using the Promise.finally method to make sure that you have proper removal of your spinner after fetching the data, while still ensuring animated content loading for your users.
    Code from video: gist.github.co...

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

  • @hashanhemachandra4832
    @hashanhemachandra4832 Год назад +2

    You are doing great work Steve! Please do not stop! You are the person who explained me what Async means. I love your content! Thanks so much for your effort. I wish, one day, you would have 1million subscribers! Then I will be first person that more happier than anyone else!

  • @nro337
    @nro337 Год назад

    This is super useful and happens too often. Nice one!

  • @proactivex
    @proactivex Год назад

    The dulcet tones of JavaScript

  • @kllokoq
    @kllokoq Год назад +1

    Very interesting. It does look much better rendering lists this way! Also I had no idea that I could place await in front of a for loop.

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  Год назад +1

      It is a relatively new type of for loop - for await of. - developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  Год назад +1

      ruclips.net/video/unDSLi5zBXU/видео.html

    • @kllokoq
      @kllokoq Год назад +1

      @@SteveGriffith-Prof3ssorSt3v3 aha, so it's a new kind of loop. Thank you!

    • @kllokoq
      @kllokoq Год назад

      @@SteveGriffith-Prof3ssorSt3v3 about 3 years ago. How did I miss it!

  • @paullebedev347
    @paullebedev347 Год назад

    Excellent piece, thank u

  • @dominiquekostler238
    @dominiquekostler238 Год назад

    Wouldn't this piece of code break if the array length is 0? So it's 2000/0?

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  Год назад +1

      It would. So you should wrap it in an if statement that will be displaying a message to the user about lack of data and only doing the calculation if there is data in the array.

  • @MrZiyak99
    @MrZiyak99 Год назад +1

    bro i love your content but this entire video could've been a 30 second short

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  Год назад +4

      Not for students who are new to Promises or the other concepts.
      Anything can be a 30 second video to an experienced developer. Or you can just download the code.
      I encourage my students to speed up the play speed as they feel comfortable.

    • @kllokoq
      @kllokoq Год назад +2

      a thing you hear in 30sec you forget in 5sec

    • @General_Aladeen
      @General_Aladeen Год назад +2

      stay away from creators who teach like "Learn this programming language" in 30mins". cause that is a scam.