Skip to content

Commit

Permalink
refactor: simplify conditionals in propagate function for better read…
Browse files Browse the repository at this point in the history
…ability
  • Loading branch information
johnsoncodehk committed Dec 25, 2024
1 parent 2b596f9 commit 7e79f82
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/reactivity/src/system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,14 @@ export function propagate(subs: Link): void {

if (!(subFlags & SubscriberFlags.Tracking)) {
if (
(!(subFlags & (SubscriberFlags.ToCheckDirty | SubscriberFlags.Dirty)) &&
((sub.flags = subFlags | targetFlag), true)) ||
(subFlags & SubscriberFlags.Recursed &&
((sub.flags = (subFlags & ~SubscriberFlags.Recursed) | targetFlag),
true))
!(
subFlags &
(SubscriberFlags.Recursed |
SubscriberFlags.ToCheckDirty |
SubscriberFlags.Dirty)
)
) {
sub.flags = (subFlags & ~SubscriberFlags.Recursed) | targetFlag
const subSubs = (sub as Dependency).subs
if (subSubs !== undefined) {
if (subSubs.nextSub !== undefined) {
Expand Down

0 comments on commit 7e79f82

Please sign in to comment.