Invalidating Unsubscribed query cache data #3677
Unanswered
surajrane42
asked this question in
Q&A
Replies: 1 comment
-
cache entries with no subscriptions will instead be cleaned up if one of their tags is invalidated - this means that if any components then subscribe to that query it'll then fetch freshly as needed. |
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
Uh oh!
There was an error while loading. Please reload this page.
-
I am new to RTK query & might be missing some basic understanding. Can someone help me with below issue
We have used RTK query in our project. There's a module where two list are rendered on two different tabs. Let's say List1 & List2. Both the lists have different endpoints for fetching the data. Both the endpoints are defined in same slice.
There is a mutation action performed on records of
List1
, after the action is successful we need to invalidate both the lists (because the record gets move from list1 to list2 & some other record details are updated)I have tried using the
dispatch(vmsApi.util.invalidateTags(['list1','list2']))
after the action. This invalidates the list1 correctly but list2 isn't invalidated. One thing to note here is I have checked in redux dev toolsgetList2
query isn't a active subscription because its not currently rendered over the UI (when user navigates to the other tab only then list2 will be rendered)I am not sure if RTK doesn't invalidates in-active subscriptions. If yes, Is there any way through which we can invalidate in-active subscriptions cache data?
Beta Was this translation helpful? Give feedback.
All reactions