exclude certain endpoints in resetApiState #3285
Unanswered
bryanprimus
asked this question in
Q&A
Replies: 1 comment 2 replies
-
No, (There is an internal "remove" action, but I'm not sure if it actually does all the cleanup you might need in such a case.) |
Beta Was this translation helpful? Give feedback.
2 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.
-
Is there a way to exclude certain endpoints from
resetApiState
util?my app has a simulation feature. when the user starts the simulation. backend will start sending simulation data.
the problem is the network request that was already made through rtk query will be cached. I need to reset all the cache data and then I found
resetApiState
, but I want to exclude some endpoints (in this case authEndpoints) so that it won't get reset.for now, I ended up separating
authApi
frommainApi
and only calling resetApiState withmainApi
but I believe as mentioned here it is not recommended way. we should only have one API slice for the rtk query
https://redux.js.org/tutorials/essentials/part-7-rtk-query-basics#defining-an-api-slice
#1725 (comment)
Beta Was this translation helpful? Give feedback.
All reactions