[REF] component: introduce RootFiber.setCounter and update scheduler

The goal is to be able to execute code whenever a root fiber is ready,
and before the next animation frame
This commit is contained in:
Géry Debongnie
2022-03-28 14:02:35 +02:00
committed by Samuel Degueldre
parent d80fad760c
commit 828be28653
5 changed files with 40 additions and 47 deletions
+2 -1
View File
@@ -245,7 +245,8 @@ export class ComponentNode<P extends object = any, E = any> implements VNode<Com
_render(fiber: Fiber | RootFiber) {
try {
fiber.bdom = this.renderFn();
fiber.root!.counter--;
const root = fiber.root!;
root.setCounter(root.counter - 1);
} catch (e) {
handleError({ node: this, error: e });
}