You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I frequently have a pattern where I manually update the cache. I have been doing this via the lifecycle of onQueryStarted as recommended in #2864. My slices looks something like this, greatly simplified:
As discussed in #4554 , this type-hack isn't available any longer. What's the proper way to type this re-used onQueryStarted function? I've tried drilling into how the type is made from the Lifecycle:
But this has a type error when attempting to dispatch the action. I'm confused about that, since it seems like that's the type that dispatch has when declaring onQueryStarted inline within the query definition.
Or maybe there's just a better way to be creating a reusable pattern here?
Any help would be appreciated.
The text was updated successfully, but these errors were encountered:
I'm working on migrating a codebase to RTK 2.0.
I frequently have a pattern where I manually update the cache. I have been doing this via the lifecycle of
onQueryStarted
as recommended in #2864. My slices looks something like this, greatly simplified:I've had those re-used
onQueryStarted
functions defined like this:As discussed in #4554 , this type-hack isn't available any longer. What's the proper way to type this re-used
onQueryStarted
function? I've tried drilling into how the type is made from the Lifecycle:But this has a type error when attempting to dispatch the action. I'm confused about that, since it seems like that's the type that
dispatch
has when declaringonQueryStarted
inline within the query definition.Or maybe there's just a better way to be creating a reusable pattern here?
Any help would be appreciated.
The text was updated successfully, but these errors were encountered: