File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ export class EffectScope {
11
11
/**
12
12
* @internal track `on` calls, allow `on` call multiple times
13
13
*/
14
- private _onCallCount = 0
14
+ private _on = 0
15
15
/**
16
16
* @internal
17
17
*/
@@ -109,8 +109,7 @@ export class EffectScope {
109
109
* @internal
110
110
*/
111
111
on ( ) : void {
112
- this . _onCallCount ++
113
- if ( this . _onCallCount === 1 ) {
112
+ if ( ++ this . _on === 1 ) {
114
113
this . prevScope = activeEffectScope
115
114
activeEffectScope = this
116
115
}
@@ -121,8 +120,7 @@ export class EffectScope {
121
120
* @internal
122
121
*/
123
122
off ( ) : void {
124
- this . _onCallCount = Math . max ( 0 , this . _onCallCount - 1 )
125
- if ( this . _onCallCount === 0 ) {
123
+ if ( this . _on > 0 && -- this . _on === 0 ) {
126
124
activeEffectScope = this . prevScope
127
125
}
128
126
}
You can’t perform that action at this time.
0 commit comments