listenerMiddleware and RTK Query #4300
-
I'm struggling to use createListenerMiddleware()'s startListening() to implement throttling for all PUT, POST and DELETE requests made with RTK Query. Even my simplest tests don't seem to work out: matcher: api.endpoints.fooBar.matchPending, // or ...Fulfilled I'm thankful for any hints! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
the listener middleware can't throttle anything from RTKQ. it's only called after actions are already dispatched, and the RTKQ mechanisms are already happening. my suspicion is that throttling would need to be done via a custom base query. |
Beta Was this translation helpful? Give feedback.
the listener middleware can't throttle anything from RTKQ. it's only called after actions are already dispatched, and the RTKQ mechanisms are already happening.
my suspicion is that throttling would need to be done via a custom base query.