We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3a89cf7 commit 5164e99Copy full SHA for 5164e99
packages/reactivity/src/effectScope.ts
@@ -76,8 +76,14 @@ export class EffectScope {
76
77
stop(fromParent?: boolean) {
78
if (this.active) {
79
- this.effects.forEach(e => e.stop())
80
let i, l
+ // #5783
81
+ // effects maybe changed when an effect stoped.
82
+ // so we need to copy it for iteration.
83
+ const effectsToStop = this.effects.slice()
84
+ for (i = 0, l = effectsToStop.length; i < l; i++) {
85
+ effectsToStop[i].stop()
86
+ }
87
for (i = 0, l = this.cleanups.length; i < l; i++) {
88
this.cleanups[i]()
89
}
0 commit comments