HelpfulHuman / Redux-Session

Redux middleware for automatic setting and hydration of state data in external storage.
MIT License
17 stars 10 forks source link

Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch #14

Open nk2580 opened 6 years ago

nk2580 commented 6 years ago

looks like the pattern of this library violates the Middleware spec for Redux now when you have state stored locally.

perhaps there needs to be a solution the the on load method implemented in a thunk? or something of that sort?

marvin-w commented 6 years ago

Did anyone find a solution for this? I'm experiencing the same issue

davidfells commented 6 years ago

Same issue. This has been here a while - is this project even maintained anymore?

marvin-w commented 6 years ago

I removed this dependency from my project and used an alternative approach for the localStorage.

const savedState = loadState(); export const store = createStore(rootReducer, savedState, composeWithDevTools()); store.subscribe(() => { saveState(store.getState()); ` });