New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
_persist clinging #589
Comments
_persist needs to exist at the level that the persistReducer is applied. This is the only safe way to track state versioning. What issue are you having with it? |
@rt2zz _persist: {} I think redux-persist should not amend internal reducer structure by adding props/_persist to it, that's just my opinion. |
Do you have a suggestion for where else to store that state? |
may be storing it internally inside some object which takes care of persist true/false flag. |
that is possible and something we might be open to, but we need to consider a couple thing:
|
same wishes i made fabric of nested reducers, and often initial state isnt the {} type |
it's also a huge problem, if reducer is |
internally, persistReducer run spread and assign at every action spread is not cheap, particularly in normalized collections with thousands of items assign work in same, wrong for perfomance way in current solution, we do them every time, in every action-fire |
...which mark all the tree-branch like "dirty", and don't give combineReducer to make this https://github.com/reactjs/redux/blob/e6463f2da9020185c6461c5975700f756e506015/src/combineReducers.js#L160 it is wrong input for connect(), who make only shallowEqual diff and think that your unchanged, but 'spread > assign' piece of data is dirty, which cause needless .render() and diff-s you don't see it, if use only flat version of reducers |
basically we could, at least, dont create new changes of |
another issues require removing _persist from state |
Sync is a difficult problem when too much is happening in a single place, current model of redux-persist with [fetch and restore] on load while [set and save] on modification works well. |
Is it possible to remove _persist clinging to every reducer on rehydrate.
The text was updated successfully, but these errors were encountered: