##// END OF EJS Templates
Added tag v1.4.0 for changeset 1a190b3a757d
Added tag v1.4.0 for changeset 1a190b3a757d

File last commit:

r109:4a375b9c654a default
r111:c8d682bcaff7 default
Show More
FunctionRendition.ts
30 lines | 922 B | video/mp2t | TypeScriptLexer
/ djx / src / main / ts / tsx / FunctionRendition.ts
cin
Converted to subproject djx, removed dojo-typings
r65 import { argumentNotNull } from "@implab/core-amd/safe";
cin
file rename
r98 import { getItemDom } from "./render";
cin
Converted to subproject djx, removed dojo-typings
r65 import { RenditionBase } from "./RenditionBase";
export class FunctionRendition extends RenditionBase<Node> {
cin
linting
r109 private readonly _component: (...args: unknown[]) => unknown;
cin
Converted to subproject djx, removed dojo-typings
r65
private _node: Node | undefined;
cin
linting
r109 constructor(component: (...args: unknown[]) => unknown) {
cin
Converted to subproject djx, removed dojo-typings
r65 super();
argumentNotNull(component, "component");
this._component = component;
}
cin
linting
r109 protected _create(attrs: object, children: unknown[]) {
const _attrs = attrs || {};
cin
Testing nested watch, release candidate
r101 const _children = children.map(x => getItemDom(x));
cin
refactoring, adding scope to rendering methods
r96 this._node = getItemDom(
cin
Testing nested watch, release candidate
r101 this._component.call(null, { ..._attrs, children: _children }));
cin
Converted to subproject djx, removed dojo-typings
r65 }
cin
added support for two arguments (props, children) form of fucntional components
r66 protected _getDomNode() {
cin
Converted to subproject djx, removed dojo-typings
r65 if (!this._node)
throw new Error("The instance of the widget isn't created");
return this._node;
}
}