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 2993a24 commit 81a6708Copy full SHA for 81a6708
packages/reactivity/src/effectScope.ts
@@ -29,26 +29,22 @@ export class EffectScope {
29
run<T>(fn: () => T): T | undefined {
30
if (this.active) {
31
try {
32
- this.on()
+ activeEffectScope = this
33
return fn()
34
} finally {
35
- this.off()
+ activeEffectScope = this.parent
36
}
37
} else if (__DEV__) {
38
warn(`cannot run an inactive effect scope.`)
39
40
41
42
on() {
43
- if (this.active) {
44
- activeEffectScope = this
45
- }
46
47
48
off() {
49
50
- activeEffectScope = this.parent
51
52
53
54
stop(fromParent?: boolean) {
0 commit comments