2
0
Эх сурвалжийг харах

chore: clarify `isUpdating` purpose to prevent recursive updates

daiwei 4 сар өмнө
parent
commit
a3a20afcd4

+ 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()