Container
Container class.
Constructor Summary
| Public Constructor | ||
| public |
constructor(domElement: Element | String) Container constructor. |
|
Member Summary
| Public Members | ||
| public get |
Child containers |
|
| public get |
Container DOM element. |
|
| public get |
Container id. |
|
| public get |
Internal contents of the container |
|
| public get |
Getter to return parent container if available. |
|
| public get |
Copy of the internal state object. |
|
Method Summary
| Public Methods | ||
| public |
appendChild(child: Container | Element | Text | String, update: Boolean, realign: Boolean): Container Append a child container. |
|
| public |
Predicate to determine if a container or its DOM element is a child of the container. |
|
| public |
Extend view model. |
|
| public |
Dispatch an event with type, optional data and optional arguments to the internal redux store. |
|
| public |
Pipe container updates to a given container. |
|
| public |
Remove a child container. |
|
| public |
Render container to a DOM element. |
|
| public |
replaceChildren(children: Array<Container | Element>): Container Replace child tree with new children. |
|
| public |
Converts container to a JSON serializable object. |
|
| public |
Returns the string reprenstation of this container. |
|
| public |
Unpipe container updates for a given container. |
|
| public |
Updates container and all child containers. |
|
| public |
Consume reducer middleware. |
|
| public |
Returns the associated value of the container. |
|
Public Constructors
Public Members
Public Methods
public appendChild(child: Container | Element | Text | String, update: Boolean, realign: Boolean): Container source
Append a child container. A child may be an instance of a Container, Element, Text, or a string. Containers are derived from their input and will cause a DOM tree to be restructured.
Example:
container.appendChild(child)
public contains(container: Container | Element, recursive: Boolean): Boolean source
Predicate to determine if a container or its DOM element is a child of the container.
Example:
if (container.contains(child)) {
...
}
public define(model: Object): Container source
Extend view model.
Params:
| Name | Type | Attribute | Description |
| model | Object |
Example:
container.define({value: 0})
public dispatch(type: Mixed, data: Object, args: Object): Container source
Dispatch an event with type, optional data and optional arguments to the internal redux store.
Example:
container.dispatch({
type: 'MY_ACTION',
data: {value: 123},
propagate: false
})
public pipe(container: Container): Container source
Pipe container updates to a given container.
Params:
| Name | Type | Attribute | Description |
| container | Container |
Example:
containerA.pipe(containerB)
public removeChild(child: Container | Element, update: Boolean, realign: Boolean): Container source
Remove a child container. A child may be an instance of a Container or Element. Containers are derived from their input and will cause a DOM tree to be restructured.
Example:
container.removeChild(child)
public render(domElement: Element): Container source
Render container to a DOM element.
Params:
| Name | Type | Attribute | Description |
| domElement | Element |
Example:
container.render(document.body)
public replaceChildren(children: Array<Container | Element>): Container source
Replace child tree with new children.
Params:
| Name | Type | Attribute | Description |
| children | Array<Container | Element> |
Example:
container.replaceChildren([childA, childB, createContainer()])
public unpipe(container: Container): Container source
Unpipe container updates for a given container.
Params:
| Name | Type | Attribute | Description |
| container | Container |
Example:
containerA.unpipe(containerB)
public update(data: Object, propagate: Boolean): Container source
Updates container and all child containers.
Example:
container.update({value: 0})
container.update({value: 0}, false)