If I put a manual dispatch just after createStore:
const store = createStore(
persistedReducer,
composeEnhancers(applyMiddleware(...))
);
const persistor = persistStore(store);
store.dispatch(myActionCreator());
the persist/REHYDRATE action fires after myAction. Is there a way to assure that REHYDRATE dispatches first?
you have a few options.
const persistor = persistStore(store, null, () => {
store.dispatch(myActionCreator())
})
I would recommend them in that order, but of course it depends on your specific needs
Option 1 worked great, big thanks!
Most helpful comment
you have a few options.
I would recommend them in that order, but of course it depends on your specific needs