@rtk-query How to clear query cache data on changed query parameters #3704
Unanswered
ollybondareva
asked this question in
Q&A
Replies: 2 comments
-
That additional data will automatically be removed 30 seconds after you stop using it. |
Beta Was this translation helpful? Give feedback.
0 replies
-
You can combine useQuery with useLazyQuery, when useQuery params changes it will clear the cache.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have infinite scroll and use merge cache data for this purposes. But I also have filter and sorting and if one of them is changed I want to clear cache and start fetching from the begging new data according to the new params.
so when someFilterIds or sortBy changes I need to clear cache. Now it's simply add more data to the cache when these params are changed. What is the best way to do that?
Beta Was this translation helpful? Give feedback.
All reactions