Modify action in ListenerMiddleware #4019
-
Is it possible to modify an action in a ListenerMiddleware (in my case, attach some I tried it with something like below, but the action received by the reducer does not have the attached property. listenerMiddleware.startListening({
matcher: isAnyOf(action1, action2, action3),
effect: (action, listenerApi) => {
action.meta = { foo: "bar" }
},
}) Is a ListenerMiddleware not suitable for that and I have to use some more general Redux middleware? |
Beta Was this translation helpful? Give feedback.
Answered by
EskiMojo14
Dec 27, 2023
Replies: 1 comment 1 reply
-
listeners will always run after the action has already reached the reducers, so it's not possible to modify the action in them. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
medihack
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
listeners will always run after the action has already reached the reducers, so it's not possible to modify the action in them.