rt2zz / redux-persist-crosstab

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

Why not middleware? #19

Open piotr-cz opened 6 years ago

piotr-cz commented 6 years ago

What it the benefit of implementing such functionality at the Redux-Persist level vs as Redux middleware (ie. like with redux-state-sync)?

Only one I can think of is that as it's dependent on Redux-Persist, so all app instances are starting with latest state.

When similar functionality is implemented as middleware, only single actions are synced. Using this module whole state is being retrieved and hydrated.

behnammodi commented 4 years ago

Of course, redux-persist-crosstab is not a middleware only. initStateWithPrevTab and withReduxStateSync is Redux level method