Skip to content

Commit ac40e83

Browse files
committed
refactor(system): rename linkSubscriber to link
1 parent c7156f3 commit ac40e83

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

src/computed.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export class Computed<T = any> implements IComputed {
4040
if (activeTrackId !== 0) {
4141
const subsTail = this.subsTail;
4242
if (subsTail === undefined || subsTail.trackId !== activeTrackId) {
43-
Dependency.linkSubscriber(this, System.activeSub!);
43+
Dependency.link(this, System.activeSub!);
4444
}
4545
}
4646
return this.cachedValue!;

src/effect.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ export class Effect<T = any> implements IEffect {
2626
) {
2727
const activeTrackId = System.activeTrackId;
2828
if (activeTrackId !== 0) {
29-
Dependency.linkSubscriber(this, System.activeSub!);
29+
Dependency.link(this, System.activeSub!);
3030
return;
3131
}
3232
if (activeEffectScope !== undefined) {
3333
const subsTail = this.subsTail;
3434
if (subsTail === undefined || subsTail.trackId !== activeEffectScope.trackId) {
35-
Dependency.linkSubscriber(this, activeEffectScope);
35+
Dependency.link(this, activeEffectScope);
3636
}
3737
}
3838
}

src/signal.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export class Signal<T = any> implements Dependency {
2525
if (activeTrackId !== 0) {
2626
const subsTail = this.subsTail;
2727
if (subsTail === undefined || subsTail.trackId !== activeTrackId) {
28-
Dependency.linkSubscriber(this, System.activeSub!);
28+
Dependency.link(this, System.activeSub!);
2929
}
3030
}
3131
return this.currentValue!;

src/system.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,14 @@ export namespace Dependency {
128128

129129
const system = System;
130130

131+
/**
132+
* @deprecated Use `startTrack` instead.
133+
*/
131134
export function linkSubscriber(dep: Dependency, sub: Subscriber) {
135+
return link(dep, sub);
136+
}
137+
138+
export function link(dep: Dependency, sub: Subscriber) {
132139
const depsTail = sub.depsTail;
133140
const old = depsTail !== undefined
134141
? depsTail.nextDep

0 commit comments

Comments
 (0)