This is a problem that we encountered in our application after we upgraded to version 1.x
, where they introduced queuing actions dispatched epic to be executed after the current stack is complete (https://github.com/redux-observable/redux-observable/pull/493).
Imagine an action (INIT_STUFF
), that has an epic that returns a list of actions (INIT_A
, INIT_B
, in that order). Each of these actions have an epic of their own. They do some stuff there and return an action that modifies the store.
In previous version of redux-observable, the epic for INIT_B
could rely on the fact that the epic for INIT_A
has completed executing and has made changes to the store. This epic could then use the updated store.
In the latest version, both the epics for INIT_A
and INIT_B
are executed in their respective order, but the actions they have returned (that modify the store) are deferred until the completion of the last epic. This means that the epic for INIT_B
does not have access to the updates in the store made by INIT_A
.
Here's a simple implementation of what I am talking about: https://redux-observable-playground-ip3qfb.stackblitz.io
What could be the migration path for a use case like this?
initialized
is never a property in your redux state. It's also unclear from the demo what the intended behavior is? I don't see any two epics relying on each other. Separately, your description I think makes sense to me, but I'd like to understand the stackblitz demo to confirm. – jayphelpsinitialized
is an object because it's the name of one of the reducers provided to combineReducers. – jayphelps