File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -37,8 +37,11 @@ export class Computed<T = any> implements IComputed {
3737 this . update ( ) ;
3838 }
3939 const activeTrackId = System . activeTrackId ;
40- if ( activeTrackId !== 0 && this . subsTail ?. trackId !== activeTrackId ) {
41- Dependency . link ( this , System . activeSub ! ) ;
40+ if ( activeTrackId !== 0 ) {
41+ const subsTail = this . subsTail ;
42+ if ( subsTail === undefined || subsTail . trackId !== activeTrackId ) {
43+ Dependency . link ( this , System . activeSub ! ) ;
44+ }
4245 }
4346 return this . cachedValue ! ;
4447 }
Original file line number Diff line number Diff line change @@ -22,8 +22,11 @@ export class Signal<T = any> implements Dependency {
2222
2323 get ( ) {
2424 const activeTrackId = System . activeTrackId ;
25- if ( activeTrackId !== 0 && this . subsTail ?. trackId !== activeTrackId ) {
26- Dependency . link ( this , System . activeSub ! ) ;
25+ if ( activeTrackId !== 0 ) {
26+ const subsTail = this . subsTail ;
27+ if ( subsTail === undefined || subsTail . trackId !== activeTrackId ) {
28+ Dependency . link ( this , System . activeSub ! ) ;
29+ }
2730 }
2831 return this . currentValue ! ;
2932 }
You can’t perform that action at this time.
0 commit comments