mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[REF] component: small cleanup
This commit makes it simpler to understand the way fibers are assigned to nodes.
This commit is contained in:
committed by
Samuel Degueldre
parent
cfcf2c6714
commit
2b565ce1b4
@@ -121,6 +121,7 @@ export class ComponentNode<T extends typeof Component = typeof Component>
|
||||
}
|
||||
|
||||
async initiateRender(fiber: Fiber | MountFiber) {
|
||||
this.fiber = fiber;
|
||||
if (this.mounted.length) {
|
||||
fiber.root.mounted.push(fiber);
|
||||
}
|
||||
@@ -146,6 +147,7 @@ export class ComponentNode<T extends typeof Component = typeof Component>
|
||||
return;
|
||||
}
|
||||
const fiber = makeRootFiber(this);
|
||||
this.fiber = fiber;
|
||||
this.app.scheduler.addFiber(fiber);
|
||||
await Promise.resolve();
|
||||
if (this.status === STATUS.DESTROYED) {
|
||||
@@ -211,6 +213,7 @@ export class ComponentNode<T extends typeof Component = typeof Component>
|
||||
async updateAndRender(props: any, parentFiber: Fiber) {
|
||||
// update
|
||||
const fiber = makeChildFiber(this, parentFiber);
|
||||
this.fiber = fiber;
|
||||
if (this.willPatch.length) {
|
||||
parentFiber.root.willPatch.push(fiber);
|
||||
}
|
||||
|
||||
@@ -70,7 +70,6 @@ export class Fiber {
|
||||
|
||||
constructor(node: ComponentNode, parent: Fiber | null) {
|
||||
this.node = node;
|
||||
node.fiber = this;
|
||||
this.parent = parent;
|
||||
if (parent) {
|
||||
const root = parent.root;
|
||||
|
||||
Reference in New Issue
Block a user