Reputation: 1477
If action FOO is dispatched and my saga starts a task via takeEvery(FOO),
Is it possible to mutate the action being dispatched so I have START_FOO instead of FOO reaching the reducer?
I know that I can have START_FOO reach the reducer via yield put({ type: START_FOO })
Upvotes: 1
Views: 1703
Reputation: 73
Try the following:
Upvotes: 0
Reputation: 67627
No. The Redux-Saga middleware always passes a dispatched action to the next middleware in the chain before trying to process it, so an action will always reach the reducers first. You would need some other middleware to modify the action instead. Redux-Saga effectively only views actions, and doesn't let you modify them.
Upvotes: 1