@dooboostore/dom-render
Version:
html view template engine
41 lines (40 loc) • 1.23 kB
JavaScript
import { ComponentBase } from "./ComponentBase.js";
import { isOnDrThisUnBind } from "../lifecycle/dr-this/OnDrThisUnBind.js";
import { RouterOutlet } from "../components/router/RouterOutlet.js";
const isOnCreatedOutlet = (obj) => typeof obj?.onCreatedOutlet === "function";
const isOnCreatedOutletDebounce = (obj) => typeof obj?.onCreatedOutletDebounce === "function";
class ComponentRouterBase extends ComponentBase {
constructor(_config) {
super(_config);
}
// get child() {
// return this._child;
// }
setChild(child) {
console.log("setChild!!", child, this.name);
if (child) {
this.child = child;
} else {
this.child = void 0;
}
const routerOutletChildren = this.getChildren(RouterOutlet.RouterOutlet);
routerOutletChildren.forEach((it) => {
it.setValue(this.child);
});
}
onDrThisUnBind() {
super.onDrThisUnBind();
if (this.child && isOnDrThisUnBind(this.child?.obj)) {
this.child.obj.onDrThisUnBind();
}
}
onCreatedThisChildDebounce(childrenSet) {
super.onCreatedThisChildDebounce(childrenSet);
}
}
export {
ComponentRouterBase,
isOnCreatedOutlet,
isOnCreatedOutletDebounce
};
//# sourceMappingURL=ComponentRouterBase.js.map