Skip to content

Commit

Permalink
refactor(reactivity): simplify flag checks in propagate function
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsoncodehk committed Dec 25, 2024
1 parent 2b596f9 commit cfb16a0
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions packages/reactivity/src/system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,10 @@ 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.ToCheckDirty | SubscriberFlags.Dirty)) ||
subFlags & SubscriberFlags.Recursed
) {
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 cfb16a0

Please sign in to comment.