-
Notifications
You must be signed in to change notification settings - Fork 862
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
[RFC] Moving to a single rehydrate action #12
Comments
Does it mean that the rehydration key will not match the reducer key anymore? It is not a big problem I guess, we may just catch them by payload parameters. I'd opt for less noise. |
@zalmoxisus yes, there would no longer be a reducer key on the action. By less noise, do you mean you would prefer it was consolidated to one action? |
Yes, having a lot of reducers could generate a lot of rehydate actions in the devtool, making it difficult for debuging. Also REHYDRATE_COMPLETE is a bit ambiguous as it is invoked only after the initial rehydratations. If we use something like persist-crosstab, one would expect to have REHYDRATE_COMPLETE when new rehydratations occur as well. Though I agree that dealing with nested data can be error prone in custom rehydration handlers. |
Will most likely make the switch in 2.0. This creates better symmetry with the Will deal with the "debugability" question with a debug option. |
Redux Persist currently emits several rehydration actions: one for every reducer. It was designed this way because it directly reflects the way redux persist works under the hood, on a per reducer basis. However we could just as easily merge every persisted value into one single 'initial state' object and fire a single
REHYDRATE
action.Pros:
REHYDRATE_COMPLETE
actionCons:
Thoughts?
The text was updated successfully, but these errors were encountered: