Say Goodbye to Excessive Loading Spinners!

Поделиться
HTML-код
  • Опубликовано: 28 сен 2024
  • Get 1 on 1 mentorship with me! ▶▶▶calendly.com/c... $45 a session
    In this video I demonstrate how to use react query to cache data for a request your user has already made, so that we can stop showing users loading animations for data that have already requested. React query makes this super easy, and in this video I show you how.
  • НаукаНаука

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

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

    Man comeback, your videos are a breath of fresh air

  • @tienvohoang5359
    @tienvohoang5359 Месяц назад

    How are you doing Chaim? It's been a while since this video released.

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

    How do u handle when data in the backend changes between calls?

    • @CodingWithChaim
      @CodingWithChaim  2 года назад +3

      React query has a default setting for when it considers data stale which I think is 5 minutes. This can of course also be configured either at the global level, or on a per query basis. Additionally, you have the ability to invalidate a key in the cache yourself, this would be useful for example after a form submission where new data was added

  • @AN-ox7sb
    @AN-ox7sb Год назад +1

    I hope that two days ago you decided to return to your channel....

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

    Great !!! Short & concise

  • @javascriptcoder-pf9hh
    @javascriptcoder-pf9hh Год назад

    Man love❤️ your videos but y aren't you releasing new videos we miss you

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

    i have a question can you please answer or make a video about how some platforms record the whole call conference into ome video (i'm talking about webrtc) also they can stream it to youtube etc ... how we can build simple webrtc app with this implementation.

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

      I can possibly look into making a video about this

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

    Chaim, How about a tutorial on React-Router 6.4 with the new createBrowserRouter and the data api?
    Please, Sir.

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

      Absolutely great idea. I hope to get to it in the near future.

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

    Cached but where? Local storage? On server via request headers?

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

      Stored in an object in memory a.k.a QueryCache object ( you can think of it as a state object )

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

      @@tomassukenik6773 So will the cache drop when the tab closed or browser closed? Thanks for the answer.

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

      ​@@ucretsiztakipci6612 when you close and reopen the browser with all tabs restored, I guess the memory is not wiped, so I'd say no, in this case. But if you'd refreshed the browser tab, to reload the whole app, the new QueryCache would be created, empty.

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

      actually I think restoring browser tab still reloads the tab, so yeah, the react query cache object would be dropped as well as any other state of the Single page app

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

      It’s stored in local memory and will get cleared out when the tab is closed

  • @worldwide6626
    @worldwide6626 11 месяцев назад +1

    Comeback please

    • @CodingWithChaim
      @CodingWithChaim  11 месяцев назад +1

      I would like nothing more, but I simply do not have the time at the moment. Hopefully in the not so distant future I will have time again

  • @melong523
    @melong523 4 месяца назад

    come back plz. I watch your vids with my bad english skills.

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

    AJAX? Is this man from 2008? These aren't AJAX requests, AJAX is with XML.

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

      developer.mozilla.org/en-US/docs/Web/Guide/AJAX

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

      it most certainly is. Axios and fetch both use the XMLHttpRequest under the hood

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

      @@internet4543 I would certainly be interested to read up on that. If you happen to find a resource, it would be awesome if you can share it