Skip to content

Commit

Permalink
chore: use > 0 instead of !== 0
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsoncodehk committed Nov 15, 2024
1 parent 0326b58 commit e682f78
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/computed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class Computed<T = any> implements IComputed {
}
}
const activeTrackId = System.activeTrackId;
if (activeTrackId !== 0) {
if (activeTrackId > 0) {
const subsTail = this.subsTail;
if (subsTail === undefined || subsTail.trackId !== activeTrackId) {
link(this, System.activeSub!);
Expand Down
2 changes: 1 addition & 1 deletion src/effect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class Effect<T = any> implements IEffect, Dependency {
public fn: () => T
) {
const activeTrackId = System.activeTrackId;
if (activeTrackId !== 0) {
if (activeTrackId > 0) {
link(this, System.activeSub!);
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/signal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class Signal<T = any> implements Dependency {

get(): NonNullable<T> {
const activeTrackId = System.activeTrackId;
if (activeTrackId !== 0) {
if (activeTrackId > 0) {
const subsTail = this.subsTail;
if (subsTail === undefined || subsTail.trackId !== activeTrackId) {
link(this, System.activeSub!);
Expand Down

0 comments on commit e682f78

Please sign in to comment.