Skip to content

Commit

Permalink
Sync alien-signals last commit
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsoncodehk committed Nov 17, 2024
1 parent 78a08bb commit 66dd59c
Showing 1 changed file with 40 additions and 48 deletions.
88 changes: 40 additions & 48 deletions packages/reactivity/src/effect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -538,31 +538,27 @@ export function checkDirty(deps: Link): boolean {
if (dep.update()) {
propagate(dep.subs!)
let dirty = true
if (stack > 0) {
let sub = deps.sub as IComputed
do {
stack--
const subSubs = sub.subs!
const prevLink = subSubs.prevSub!
subSubs.prevSub = undefined
if (dirty) {
if (sub.update()) {
propagate(subSubs)
deps = prevLink
sub = prevLink.sub as IComputed
dirty = true
continue
}
} else {
sub.dirtyLevel = DirtyLevels.None
while (stack > 0) {
stack--
const sub = deps.sub as IComputed
const subSubs = sub.subs!
const prevLink = subSubs.prevSub!
subSubs.prevSub = undefined
if (dirty) {
if (sub.update()) {
propagate(subSubs)
deps = prevLink
dirty = true
continue
}
deps = prevLink.nextDep!
if (deps !== undefined) {
continue top
}
dirty = false
sub = prevLink.sub as IComputed
} while (stack > 0)
} else {
sub.dirtyLevel = DirtyLevels.None
}
deps = prevLink.nextDep!
if (deps !== undefined) {
continue top
}
dirty = false
}
return dirty
}
Expand All @@ -572,31 +568,27 @@ export function checkDirty(deps: Link): boolean {
const nextDep = deps.nextDep!
if (nextDep === undefined) {
let dirty = false
if (stack > 0) {
let sub = deps.sub as IComputed
do {
stack--
const subSubs = sub.subs!
const prevLink = subSubs.prevSub!
subSubs.prevSub = undefined
if (dirty) {
if (sub.update()) {
propagate(subSubs)
deps = prevLink
sub = prevLink.sub as IComputed
dirty = true
continue
}
} else {
sub.dirtyLevel = DirtyLevels.None
}
deps = prevLink.nextDep!
if (deps !== undefined) {
continue top
while (stack > 0) {
stack--
const sub = deps.sub as IComputed
const subSubs = sub.subs!
const prevLink = subSubs.prevSub!
subSubs.prevSub = undefined
if (dirty) {
if (sub.update()) {
propagate(subSubs)
deps = prevLink
dirty = true
continue
}
sub = prevLink.sub as IComputed
dirty = false
} while (stack > 0)
} else {
sub.dirtyLevel = DirtyLevels.None
}
deps = prevLink.nextDep!
if (deps !== undefined) {
continue top
}
dirty = false
}
return dirty
}
Expand Down

0 comments on commit 66dd59c

Please sign in to comment.