Skip to content

Commit

Permalink
refactor: use alias Notified for `InnerEffectsPending | ToCheckDirt…
Browse files Browse the repository at this point in the history
…y | Dirty`
  • Loading branch information
johnsoncodehk committed Jan 10, 2025
1 parent 2233d45 commit b050da4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export const enum SubscriberFlags {
InnerEffectsPending = 1 << 2,
ToCheckDirty = 1 << 3,
Dirty = 1 << 4,
Notified = InnerEffectsPending | ToCheckDirty | Dirty,
}

let batchDepth = 0;
Expand Down Expand Up @@ -130,7 +131,7 @@ export function propagate(link: Link): void {

if (
(
!(subFlags & (SubscriberFlags.Tracking | SubscriberFlags.Recursed | SubscriberFlags.InnerEffectsPending | SubscriberFlags.ToCheckDirty | SubscriberFlags.Dirty))
!(subFlags & (SubscriberFlags.Tracking | SubscriberFlags.Recursed | SubscriberFlags.Notified))
&& (sub.flags = subFlags | targetFlag, true)
)
|| (
Expand All @@ -139,7 +140,7 @@ export function propagate(link: Link): void {
&& (sub.flags = (subFlags & ~SubscriberFlags.Recursed) | targetFlag, true)
)
|| (
!(subFlags & (SubscriberFlags.InnerEffectsPending | SubscriberFlags.ToCheckDirty | SubscriberFlags.Dirty))
!(subFlags & SubscriberFlags.Notified)
&& isValidLink(link, sub)
&& (
sub.flags = subFlags | SubscriberFlags.Recursed | targetFlag,
Expand Down Expand Up @@ -174,7 +175,7 @@ export function propagate(link: Link): void {
!(subFlags & (SubscriberFlags.Tracking | targetFlag))
|| (
!(subFlags & targetFlag)
&& (subFlags & (SubscriberFlags.InnerEffectsPending | SubscriberFlags.ToCheckDirty | SubscriberFlags.Dirty))
&& (subFlags & SubscriberFlags.Notified)
&& isValidLink(link, sub)
)
) {
Expand Down

0 comments on commit b050da4

Please sign in to comment.