3 ms·
Wouldn't it make more sense to stick this view persisted state in your Redux store? (and write it to LocalStorage with a throttle). Dan Abramov does it that way
by ronyfadel 7y ago
Wouldn't it make more sense to stick this view persisted state in your Redux store? (and write it to LocalStorage with a throttle). Dan Abramov does it that way in [0]
It would make handling your data much more sane (it all lives in one place, your Redux store), making it easier to sync (just sync your store's state), solve the key collision issues (with the author's implementation, separate components can overwrite each other's data).
[0] https://egghead.io/lessons/javascript-redux-persisting-the-state-to-the-local-storage https://egghead.io/lessons/javascript-redux-persisting-the-s...
- jakelazaroff 7y agoNot all React applications use Redux.