Skip to content

Commit

Permalink
Update system.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsoncodehk committed Jan 10, 2025
1 parent 46ab8c7 commit 56fc582
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,15 @@ function drainQueuedEffects(): void {

export function link(dep: Dependency, sub: Subscriber): void {
const currentDep = sub.depsTail;
let nextDep: Link | undefined;
if (currentDep !== undefined) {
if (currentDep.dep === dep) {
return;
}
nextDep = currentDep.nextDep;
} else {
nextDep = sub.deps;
if (
currentDep !== undefined
&& currentDep.dep === dep
) {
return;
}
const nextDep = currentDep !== undefined
? currentDep.nextDep
: sub.deps;
if (
nextDep !== undefined
&& nextDep.dep === dep
Expand Down

0 comments on commit 56fc582

Please sign in to comment.