Parcourir la source

chore: clarify `isUpdating` purpose to prevent recursive updates

daiwei il y a 4 mois
Parent
commit
a3a20afcd4
1 fichiers modifiés avec 1 ajouts et 2 suppressions
  1. 1 2
      packages/runtime-vapor/src/renderEffect.ts

+ 1 - 2
packages/runtime-vapor/src/renderEffect.ts

@@ -53,8 +53,6 @@ export class RenderEffect extends ReactiveEffect {
 
     this.job = job
     this.i = instance
-
-    // TODO recurse handling
   }
 
   fn(): void {
@@ -67,6 +65,7 @@ export class RenderEffect extends ReactiveEffect {
     }
     const prev = setCurrentInstance(instance, scope)
     if (hasUpdateHooks && instance.isMounted && !instance.isUpdating) {
+      // avoid recurse update until updateJob flushed
       instance.isUpdating = true
       instance.bu && invokeArrayFns(instance.bu)
       this.render()