Browse Source

refactor(reactivity): simplify isDirty condition (#11933)

Tycho 1 year ago
parent
commit
346bfaf760
1 changed files with 3 additions and 2 deletions
  1. 3 2
      packages/reactivity/src/effect.ts

+ 3 - 2
packages/reactivity/src/effect.ts

@@ -311,8 +311,9 @@ 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)) ||
-      link.dep.version !== link.version
+      (link.dep.computed &&
+        (refreshComputed(link.dep.computed) ||
+          link.dep.version !== link.version))
     ) {
       return true
     }