@@ -45,6 +45,7 @@ export const System = {
45
45
lastTrackId : 0 ,
46
46
queuedEffects : undefined as IEffect | undefined ,
47
47
queuedEffectsTail : undefined as IEffect | undefined ,
48
+ linkPool : undefined as Link | undefined ,
48
49
} ;
49
50
50
51
export function startBatch ( ) : void {
@@ -74,8 +75,6 @@ export function drainQueuedEffects(): void {
74
75
}
75
76
}
76
77
77
- let linkPool : Link | undefined = undefined ;
78
-
79
78
export function link ( dep : Dependency , sub : Subscriber ) : void {
80
79
const depsTail = sub . depsTail ;
81
80
const old = depsTail !== undefined
@@ -85,9 +84,9 @@ export function link(dep: Dependency, sub: Subscriber): void {
85
84
if ( old === undefined || old . dep !== dep ) {
86
85
let newLink : Link ;
87
86
88
- if ( linkPool !== undefined ) {
89
- newLink = linkPool ;
90
- linkPool = newLink . nextDep ;
87
+ if ( System . linkPool !== undefined ) {
88
+ newLink = System . linkPool ;
89
+ System . linkPool = newLink . nextDep ;
91
90
newLink . nextDep = old ;
92
91
newLink . dep = dep ;
93
92
newLink . sub = sub ;
@@ -376,8 +375,8 @@ export function clearTrack(link: Link): void {
376
375
link . sub = undefined ;
377
376
link . prevSub = undefined ;
378
377
link . nextSub = undefined ;
379
- link . nextDep = linkPool ;
380
- linkPool = link ;
378
+ link . nextDep = System . linkPool ;
379
+ System . linkPool = link ;
381
380
382
381
if ( dep . subs === undefined && 'deps' in dep ) {
383
382
if ( 'notify' in dep ) {
0 commit comments