File tree 2 files changed +5
-15
lines changed
2 files changed +5
-15
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ export class EffectScope implements Subscriber, Dependency {
50
50
this . flags |= EffectFlags . PAUSED
51
51
for ( let link = this . deps ; link !== undefined ; link = link . nextDep ) {
52
52
const dep = link . dep
53
- if ( 'notify ' in dep ) {
53
+ if ( 'pause ' in dep ) {
54
54
dep . pause ( )
55
55
}
56
56
}
@@ -66,7 +66,7 @@ export class EffectScope implements Subscriber, Dependency {
66
66
this . flags = flags & ~ EffectFlags . PAUSED
67
67
for ( let link = this . deps ; link !== undefined ; link = link . nextDep ) {
68
68
const dep = link . dep
69
- if ( 'notify ' in dep ) {
69
+ if ( 'resume ' in dep ) {
70
70
dep . resume ( )
71
71
}
72
72
}
@@ -113,26 +113,14 @@ export class EffectScope implements Subscriber, Dependency {
113
113
stop ( ) : void {
114
114
if ( this . active ) {
115
115
this . flags |= EffectFlags . STOP
116
-
117
- let link = this . deps
118
- while ( link !== undefined ) {
119
- const next = link . nextDep
120
- const dep = link . dep
121
- if ( 'notify' in dep ) {
122
- dep . stop ( )
123
- }
124
- link = next
125
- }
126
116
while ( this . deps !== undefined ) {
127
117
unlink ( this . deps )
128
118
}
129
-
130
119
const l = this . cleanupsLength
131
120
for ( let i = 0 ; i < l ; i ++ ) {
132
121
this . cleanups [ i ] ( )
133
122
}
134
123
this . cleanupsLength = 0
135
-
136
124
if ( this . subs !== undefined ) {
137
125
unlink ( this . subs )
138
126
}
Original file line number Diff line number Diff line change @@ -127,7 +127,9 @@ export function unlink(link: Link): void {
127
127
}
128
128
if ( dep . subs === undefined && 'deps' in dep ) {
129
129
const depFlags = dep . flags
130
- if ( ! ( depFlags & SubscriberFlags . Dirty ) ) {
130
+ if ( 'stop' in dep ) {
131
+ dep . stop ( )
132
+ } else if ( ! ( depFlags & SubscriberFlags . Dirty ) ) {
131
133
dep . flags = depFlags | SubscriberFlags . Dirty
132
134
}
133
135
while ( dep . deps !== undefined ) {
You can’t perform that action at this time.
0 commit comments