##// END OF EJS Templates
Added Renderer, WatchRendition
Added Renderer, WatchRendition

File last commit:

r67:ff3695b0a48f v1.1.1 default
r94:131e369d1143 default
Show More
FunctionRendition.ts
30 lines | 878 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";
import { RenditionBase } from "./RenditionBase";
export class FunctionRendition extends RenditionBase<Node> {
cin
added support for two arguments (props, children) form of fucntional components
r66 private _component: (...args: any[]) => any;
cin
Converted to subproject djx, removed dojo-typings
r65
private _node: Node | undefined;
cin
added support for two arguments (props, children) form of fucntional components
r66 constructor(component: (...args: any[]) => any) {
cin
Converted to subproject djx, removed dojo-typings
r65 super();
argumentNotNull(component, "component");
this._component = component;
}
cin
added support for two arguments (props, children) form of fucntional components
r66 protected _create(attrs: object, children: any[]) {
cin
Converted to subproject djx, removed dojo-typings
r65 const _attrs: any = attrs || {};
cin
added support for two arguments (props, children) form of fucntional components
r66 const _children = children.map(x => this.getItemDom(x));
this._node = this.getItemDom(
cin
Fixed RenditionBase.placeAt for DjxFragment
r67 this._component.call(null, { ..._attrs, children: _children })
cin
added support for two arguments (props, children) form of fucntional components
r66 );
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;
}
}