"skipping autoRehydrate" throw for nested Object and Array
See original GitHub issueI try to mix redux-persist
with https://github.com/omnidan/redux-undo for fun
but what I found so far is when I have nested object array (generated by undoredo), autoRehydrate
will refuse to work.
And that because https://github.com/rt2zz/redux-persist/blob/master/src/autoRehydrate.js#L61 compare…
if (state[key] !== reducedState[key]) {
which…
state[key]: Object {past: Array[0], present: Array[0], future: Array[0], history: Object}
reducedState[key]: Object {past: Array[0], present: Array[0], future: Array[0], history: Object}
is (kinda) same (blank) value but (obviously) different object so it didn’t equal anyway.
Any hint to make it work?
Thanks
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Can you skip a level in a nested object without knowing the ...
I want to remove or and skip through directly to the children. But it is a random produced key value "between". How can...
Read more >Accessing Nested Objects in JavaScript - DEV Community
Array reduce method is very powerful and it can be used to safely access nested objects. const getNestedObject = (nestedObj, pathArr) = ...
Read more >Using ES6 To Destructure Deeply Nested Objects in ... - ITNEXT
Today, I will show you how to use ES6 to destructure nested objects, my friends, AND what's more, prevent the dreaded undefined error...
Read more >Archie Markup Language (ArchieML) 1.0
Nested arrays can be either Object or String arrays, using the same rules as top-level arrays for determining the type. Only object arrays...
Read more >Heres how JavaScript's Nested Object Destructuring works
A quick video detailing how destructuring works with nested objects and arrays. Check out my https://ES6.io course for more!
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I was able to get around this problem by adjusting my reducer to clone the array, instead of just directly modifying its values.
This reducer was being ignored by
autoRehydrate
:Fixed:
Hope this helps ✌️👍
This hasn’t been responded to in a long while, so I’m going to mark it as stale. Please feel free to continue the conversation and I’ll reopen.