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. - Наука
Man comeback, your videos are a breath of fresh air
How are you doing Chaim? It's been a while since this video released.
How do u handle when data in the backend changes between calls?
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
I hope that two days ago you decided to return to your channel....
why two days ago?
@@CodingWithChaim head of the year
Great !!! Short & concise
Man love❤️ your videos but y aren't you releasing new videos we miss you
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.
I can possibly look into making a video about this
Chaim, How about a tutorial on React-Router 6.4 with the new createBrowserRouter and the data api?
Please, Sir.
Absolutely great idea. I hope to get to it in the near future.
Cached but where? Local storage? On server via request headers?
Stored in an object in memory a.k.a QueryCache object ( you can think of it as a state object )
@@tomassukenik6773 So will the cache drop when the tab closed or browser closed? Thanks for the answer.
@@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.
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
It’s stored in local memory and will get cleared out when the tab is closed
Comeback please
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
come back plz. I watch your vids with my bad english skills.
AJAX? Is this man from 2008? These aren't AJAX requests, AJAX is with XML.
developer.mozilla.org/en-US/docs/Web/Guide/AJAX
it most certainly is. Axios and fetch both use the XMLHttpRequest under the hood
@@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