[IMP] component: re-introduce error handling in lifecycle

This commit is contained in:
Lucas Perais (lpe)
2021-11-08 10:30:36 +01:00
committed by Géry Debongnie
parent e611c20ab4
commit ad4673cb36
8 changed files with 668 additions and 65 deletions
+5 -1
View File
@@ -2,6 +2,7 @@ import type { BDom } from "../blockdom";
import { mount } from "../blockdom";
import type { ComponentNode } from "./component_node";
import { STATUS } from "./status";
import { fibersInError } from "./error_handling";
// import { mountBlock } from "./bdom/block";
export function makeChildFiber(node: ComponentNode, parent: Fiber): Fiber {
@@ -27,6 +28,10 @@ export function makeRootFiber(node: ComponentNode): Fiber {
current.children = [];
root.counter++;
current.bdom = null;
if (fibersInError.has(current)) {
fibersInError.delete(current);
fibersInError.delete(root);
}
return current;
}
const fiber = new RootFiber(node);
@@ -81,7 +86,6 @@ export class Fiber {
export class RootFiber extends Fiber {
counter: number = 1;
error: Error | null = null;
resolve: any;
promise: Promise<any>;
reject: any;