elgerlambert / redux-localstorage

Store enhancer that syncs (a subset) of your Redux store state to localstorage.
MIT License
1.32k stars 107 forks source link

Do not disable buffer until all queued actions dispatched #68

Open alanshaw opened 7 years ago

alanshaw commented 7 years ago

This PR alters bufferActions.js to not disable the buffer until all actions in the queue are dispatched.

The issue I had was that whilst the buffer was being purged, the dispatched actions in the queue were causing other actions to be dispatched by other parts of the code (like in componentDidMount). Since buffer = false had already been set, these actions passed through the bufferActions middleware and got dispatched and reduced before the buffer had finished emptying - causing them to be incorrectly ordered.

resolves #67

alanshaw commented 7 years ago

Hi @elgerlambert any thoughts on this one? Could we get it merged and published?

alanshaw commented 7 years ago

@elgerlambert ping?