Pass an aditional parameter to RTK Query action payload #1642
Unanswered
filipkrayem
asked this question in
Q&A
Replies: 1 comment 3 replies
-
Honestly, this sounds like an antipattern in the making, working against your library instead of with it - and it might be the case that you are trying to solve a problem that usually should not even come up here. What are you actually trying to do? |
Beta Was this translation helpful? Give feedback.
3 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.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, is it possible to somehow pass additional parameters (functions in this case) to the
action
fired from RTK Query?I want to be able to pass
onSuccess
andonError
functions that are going to be handling errors. I know I can just put atry catch
block inside the query and handle it there, but I'd like to move that logic to the middleware since it's cleaner and a better developer experience.Beta Was this translation helpful? Give feedback.
All reactions