mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[FIX] move error handling out of fiber, fix complicated mounted issues
This commit is contained in:
committed by
Lucas Perais - lpe@odoo
parent
240259568e
commit
b3fb9a35bf
+10
-1
@@ -1,3 +1,4 @@
|
||||
import { onError, onMounted } from "../component/lifecycle_hooks";
|
||||
import { Component } from "../component/component";
|
||||
import { ComponentNode } from "../component/component_node";
|
||||
import { MountOptions } from "../component/fibers";
|
||||
@@ -64,8 +65,16 @@ export class App<T extends typeof Component = any> extends TemplateSet {
|
||||
throw new Error("Cannot mount a component on a detached dom node");
|
||||
}
|
||||
const node = new ComponentNode(this.Root, this.props, this);
|
||||
const promise: any = new Promise((resolve, reject) => {
|
||||
onMounted(() => resolve(node.component));
|
||||
onError((e) => {
|
||||
reject(e);
|
||||
throw e;
|
||||
});
|
||||
});
|
||||
this.root = node;
|
||||
return node.mountComponent(target, options);
|
||||
node.mountComponent(target, options);
|
||||
return promise;
|
||||
}
|
||||
|
||||
destroy() {
|
||||
|
||||
Reference in New Issue
Block a user