Skip to content

Commit ea6c064

Browse files
committed
fix(reactivity): properly cleanup effectScope
1 parent c14171e commit ea6c064

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/reactivity/src/effect.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,12 +271,12 @@ export function resetTracking(): void {
271271
export function cleanup(
272272
sub: ReactiveNode & { cleanups: (() => void)[]; cleanupsLength: number },
273273
): void {
274-
const l = sub.cleanupsLength
274+
const l = sub.cleanups.length
275275
if (l) {
276276
for (let i = 0; i < l; i++) {
277277
sub.cleanups[i]()
278278
}
279-
sub.cleanupsLength = 0
279+
sub.cleanups.length = sub.cleanupsLength = 0
280280
}
281281
}
282282

0 commit comments

Comments
 (0)