##// END OF EJS Templates
`Subscribable` is made compatible with rxjs, added map, filter and scan...
`Subscribable` is made compatible with rxjs, added map, filter and scan methods to observables. `watch` can accept either stateful object and a property name to observe or the subscribable value. added ref attribute to the markup elements and widgets. `bind`, `tooggleClass` and `attach` methods can be passed to `ref` attribute in the markup to interact with elemnts and widgets.

File last commit:

r101:bb6b1db1b430 v1.3
r102:c65ea2350b1a v1.3
Show More
FunctionRendition.ts
30 lines | 898 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
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
Testing nested watch, release candidate
r101 protected _create(attrs: object, children: any[]) {
cin
Converted to subproject djx, removed dojo-typings
r65 const _attrs: any = 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;
}
}