Closed tuntisz closed 6 years ago
If any action occurs between redux-async-initial-state/STATE_LOADING_START and redux-async-initial-state/STATE_LOADING_DONE, currentState becomes out of sync.
redux-async-initial-state/STATE_LOADING_START
redux-async-initial-state/STATE_LOADING_DONE
currentState
By passing getState instead of getState(), developers are able to grab the latest store on promise resolution. https://github.com/KELiON/redux-async-initial-state/blob/master/src/middleware.js#L7
getState
getState()
I just encountered this as well. 100% need a way to get the current state, otherwise valuable data is getting removed from my store.
https://github.com/KELiON/redux-async-initial-state/pull/13
If any action occurs between
redux-async-initial-state/STATE_LOADING_START
andredux-async-initial-state/STATE_LOADING_DONE
,currentState
becomes out of sync.By passing
getState
instead ofgetState()
, developers are able to grab the latest store on promise resolution. https://github.com/KELiON/redux-async-initial-state/blob/master/src/middleware.js#L7