Open radebrecht opened 5 years ago
Ah, that's an interesting case. Yeah, so since the middleware only looks at the actions coming through, unless the persistActions
included BATCH_ACTIONS
it wouldn't know to persist.
This could be mitigated, but would also require a change to redux-persist-middleware.
I agree it would be nice if this just worked, I'll see if I can find time to do this at some point. Or you're welcome to.
Essentially you'd need to change redux-bundler's BATCH_ACTIONS
to attach the action types it's including as a property of the action. I'd suggest ._batchedActions
. Then, redux-persist-middleware would also have to look for that property of the action.
A bundle
X
dispatches aBATCH_ACTION
, containing actionA
from bundleY
and actionB
from bundleZ
. BothA
andB
are marked aspersistenceActions
in their respective bundles. Problem: theBATCH_ACTION
correctly executesA
andB
, but nothing is persisted.It seems that when actions are combined into BATCH_ACTIONS, the
persistenceActions
option of the individual actions are ignored.