This is a bit of an exceptional example because the states basically never change. In other sfenarios it is useful to be able to have a force mode or an expiry check (store the last response timestamp). But a very good example with the interceptor otherwise, because this is where the logic belongs.
One doubt, if let say there is some change in states( new states are added) in between our use case, i.e we have first hit the get request and got the data and set it using map. But during this time new states have been added, with this logic new state wont be reflected in UI since we are using cache, until we reload the page. How can we fix this issue?
This is a bit of an exceptional example because the states basically never change. In other sfenarios it is useful to be able to have a force mode or an expiry check (store the last response timestamp). But a very good example with the interceptor otherwise, because this is where the logic belongs.
Very nicely explained
Keep watching
Very beautifully explained
Thank you. Keep watching 👍
When will you reset the cache?
There are many cases you can clear the cache, like the data changed by some events that time you can do.
Good one,
One question, when we need to update our cache, like timestamp.
Could have mentioned, which situations we should opt cache techniques.
If you want to store the cache for specific time period, then timestamp will come. Other wise it will lifetime.
One doubt, if let say there is some change in states( new states are added) in between our use case, i.e we have first hit the get request and got the data and set it using map. But during this time new states have been added, with this logic new state wont be reflected in UI since we are using cache, until we reload the page. How can we fix this issue?
There is method called clear cache, you can call and clear on state changed. Let me know if you any doubt I will share code. Keep watching!
I have a question if refres a page, the data in cache global is destroy? or exist after.
Data will be there in all the pages, until reload the pages
@@partharanjan thanks.
Hi Sir.. I would like to learn few concepts from you and would like to pay you... Could you please let me know how to contact you?
Thank you. Keep watching. You can feel free to ask any question here. I am happy to help. 😊