refactor(runtime-core): simplify deep watch traverse (#2212)
This commit is contained in:
parent
e2c9ab1991
commit
9b34f915ab
@ -333,13 +333,8 @@ function traverse(value: unknown, seen: Set<unknown> = new Set()) {
|
||||
for (let i = 0; i < value.length; i++) {
|
||||
traverse(value[i], seen)
|
||||
}
|
||||
} else if (isMap(value)) {
|
||||
value.forEach((_, key) => {
|
||||
// to register mutation dep for existing keys
|
||||
traverse(value.get(key), seen)
|
||||
})
|
||||
} else if (isSet(value)) {
|
||||
value.forEach(v => {
|
||||
} else if (isSet(value) || isMap(value)) {
|
||||
value.forEach((v: any) => {
|
||||
traverse(v, seen)
|
||||
})
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user