KELiON / redux-async-initial-state

Redux middleware that helps you load redux initial state asynchronously
MIT License
114 stars 12 forks source link

Issue #11: Fix out-of-sync state #13

Closed tuntisz closed 6 years ago

tuntisz commented 7 years ago

Passing getState as a function fixes a race condition that can occur if actions are dispatched between redux-async-initial-state-/STATE_LOADING_START and redux-async-initial-state-/STATE_LOADING_DONE.

By passing getState as the second parameter to the load function, backwards compatibility is maintained.

tuntisz commented 7 years ago

@KELiON Thanks for your work on redux-async-initial-state. It's been a big part of a project I'm working on.

Let me know your thoughts on maintaining backwards compatibility versus dropping a major release. I'd be happy to update this to pass just the one parameter store.getState

tuntisz commented 7 years ago

cc @jdolle

tuntisz commented 7 years ago

@KELiON following up here

KELiON commented 6 years ago

@tuntisz sorry for so long pause! I'd better do better API rather than backward compatibility and I think passing just one functional param is better. Can you please update your code and readme so I can release a new major version?

conor909 commented 6 years ago

@tuntisz have you had any word on the status of this?

tuntisz commented 6 years ago

@conor909 @KELiON I've updated the PR with the requested API updated.

conor909 commented 6 years ago

@KELiON can we get this released?