ericelliott / autodux

Automate the Redux boilerplate.
MIT License
592 stars 32 forks source link

What's the best practice for creating actions that do not transform state? #213

Closed magbicaleman closed 2 years ago

magbicaleman commented 4 years ago

I'm not sure why I'm having a hard time with this but, I'm struggling to find a way to create an action that Saga can listen to, without autodux having to update the state. Without trying to create an action outside of my autodux.

For example, if I'm creating a "REQUEST" action, without it setting any state, that my saga can listen to, but autodux isn't expecting to change the state. I want my saga to dispatch, and then update state based on request-response.

Is this the solution?

actions: { startMarkRead: (state) => state, }

ericelliott commented 2 years ago

Yes.