We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0f9c8c4 commit 437645dCopy full SHA for 437645d
1 file changed
src/util/mobx-persist/types.ts
@@ -6,7 +6,15 @@ import {
6
} from 'serializr'
7
8
function _walk(v: any) {
9
- if (typeof v === 'object' && v) Object.keys(v).map(k => _walk(v[k]))
+ if (typeof v === 'object' && v) {
10
+ if (Array.isArray(v)) {
11
+ // Make sure we read .length as well as values to observe
12
+ // the array even if it's empty.
13
+ for (let i = 0; i < v.length; i++) _walk(v[i]);
14
+ } else {
15
+ Object.keys(v).map(k => _walk(v[k]));
16
+ }
17
18
return v
19
}
20
0 commit comments