Skip to content

Commit 678da8b

Browse files
committed
fix(vue): suppress callback error
1 parent 2a6ff9f commit 678da8b

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

unstable/vue.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ class VueEffectScope extends EffectScope {
2121

2222
stop() {
2323
super.stop();
24-
for (const cb of this.onDispose) {
25-
cb();
26-
}
24+
this.onDispose.forEach(cb => cb());
2725
}
2826
}
2927

@@ -78,12 +76,6 @@ class VueComputed<T = any> extends Computed<T> {
7876
}
7977

8078
export class ReactiveEffect extends Effect {
81-
onDispose: (() => void)[] = [];
82-
83-
constructor(fn: () => void) {
84-
super(fn);
85-
}
86-
8779
get dirty() {
8880
if (this.versionOrDirtyLevel === DirtyLevels.MaybeDirty) {
8981
Subscriber.resolveMaybeDirty(this);
@@ -97,9 +89,6 @@ export class ReactiveEffect extends Effect {
9789

9890
stop() {
9991
Subscriber.clearTrack(this);
100-
for (const cb of this.onDispose) {
101-
cb();
102-
}
10392
}
10493
}
10594

0 commit comments

Comments
 (0)