Best practices for caching list/detail data #3689
Unanswered
JurajKavka
asked this question in
Q&A
Replies: 1 comment 3 replies
-
Check this document https://react-query.tanstack.com/guides/initial-query-data
|
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
what is the best practice for caching list/detail data? It's simple a commonly used concept in Redux. Imagne, you have page with list view so all of the list data is stored in cache and rendered in table. When user clicks on list item, he is routed to detail URL with some id. In detail URL page, I want to instantly show data that we have in cache already (i.e. title, perex, etc) but in background request for detail data is fired and those data should be stored in cache too. In Redux store I just rewrite list data with detail data - but the place of data in cache is exactly the same.
Ho to do the same in react-query? Or is there a better concept? Can I modify data in cache where I have stored list of data?
Thank You.
J.
Beta Was this translation helpful? Give feedback.
All reactions