You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since data:{} default is not applied but totally removed because ignored in the transform I get errors.
How can I deal with this situation? Persist just wanted keys and apply defaults to the others?
Would it be possible to always rehydrate to the default and then apply the rehydration of wanted subkeys?
The text was updated successfully, but these errors were encountered:
@edy Any hints on this? This prevents from using nested keys (a.b.c) as the loaded state isn't properly merged to the existing state, rather replaces it completely.
Edit
This problem is actually caused by redux-persist only supporting (out of the box) 2 levels of auto merging. Implementing a deep merge state reconciler might be the way to go.
@edy thanks for this repo!
It seems the rehydration is not properly dealing with defaults when using transforms.
Here my default state:
Here the persist transforms applied (I want only main.token to be persisted):
What happens after rehydrate dispatch is the following:
Since
data:{}
default is not applied but totally removed because ignored in the transform I get errors.How can I deal with this situation? Persist just wanted keys and apply defaults to the others?
Would it be possible to always rehydrate to the default and then apply the rehydration of wanted subkeys?
The text was updated successfully, but these errors were encountered: