rt2zz / redux-persist-crosstab

Keep redux browser tab state in sync
85 stars 27 forks source link

Local storage on multiple dispatches to state updates, causes inconsistency in data #13

Closed skyshader closed 7 years ago

skyshader commented 7 years ago

Right now I am facing the issue where I have to update multiple reducers one after other. This creates inconsistency in the local storage.

How inconsistency is happening:

I was thinking that if I would have a function that I would call to actually flush the data to the storage, so the event only triggers once with the complete set of updated data.

Or is there some better solution that already exists for this, maybe to batch the dispatches for state updates across multiple reducers and put the data at once in the local storage?

skyshader commented 7 years ago

I understood that it was me who had to handle it in the REHYDRATE case of the reducer. Not a problem with the library.