File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed
Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -138,11 +138,10 @@ export function effect(fn: () => void): () => void {
138138 depsTail : undefined ,
139139 flags : 2 satisfies ReactiveFlags . Watching ,
140140 } ;
141- const sub = activeSub ;
142- if ( sub !== undefined ) {
143- link ( e , sub , 0 ) ;
144- }
145141 const prevSub = setActiveSub ( e ) ;
142+ if ( prevSub !== undefined ) {
143+ link ( e , prevSub , 0 ) ;
144+ }
146145 try {
147146 e . fn ( ) ;
148147 } finally {
@@ -159,11 +158,10 @@ export function effectScope(fn: () => void): () => void {
159158 subsTail : undefined ,
160159 flags : 0 satisfies ReactiveFlags . None ,
161160 } ;
162- const sub = activeSub ;
163- if ( sub !== undefined ) {
164- link ( e , sub , 0 ) ;
165- }
166161 const prevSub = setActiveSub ( e ) ;
162+ if ( prevSub !== undefined ) {
163+ link ( e , prevSub , 0 ) ;
164+ }
167165 try {
168166 fn ( ) ;
169167 } finally {
You can’t perform that action at this time.
0 commit comments