-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Revert "fix: Revert "fix(reactivity): self-referencing computed …
…should refresh"" This reverts commit 35c760f.
- Loading branch information
Showing
3 changed files
with
7 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -326,7 +326,7 @@ function isDirty(sub: Subscriber): boolean { | |
for (let link = sub.deps; link; link = link.nextDep) { | ||
if ( | ||
link.dep.version !== link.version || | ||
(link.dep.computed && refreshComputed(link.dep.computed) === false) || | ||
(link.dep.computed && refreshComputed(link.dep.computed)) || | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
yyx990803
Author
Member
|
||
link.dep.version !== link.version | ||
) { | ||
return true | ||
|
@@ -344,10 +344,7 @@ function isDirty(sub: Subscriber): boolean { | |
* Returning false indicates the refresh failed | ||
* @internal | ||
*/ | ||
export function refreshComputed(computed: ComputedRefImpl): false | undefined { | ||
if (computed.flags & EffectFlags.RUNNING) { | ||
return false | ||
} | ||
export function refreshComputed(computed: ComputedRefImpl): undefined { | ||
if ( | ||
computed.flags & EffectFlags.TRACKING && | ||
!(computed.flags & EffectFlags.DIRTY) | ||
|
@yyx990803 this check looks dubious to me.
refreshComputed()
returns onlyundefined
now, so this condition will never be met, but calling it will have side-effects? Is this the intention here?