Function
Static Public Summary | ||
public |
JSX factory function to create an object representing a dom node. |
|
public |
Can be used as a simple if/else statement info your jsx :
|
|
public |
Render some elements into a node. |
|
public |
renderToDom(node: string | Node, component: Component, store: Store) Render a component to the dom. |
|
public |
renderToString(elements: Array): string Render some elements into a string. |
Static Public
public el(element: Object | Component | string | function, attrs: Object, children: Array): Object source
import {el} from 'simpledom-component'
JSX factory function to create an object representing a dom node. Designed to be used with a JSX transpiler.
public predicate(cond: boolean | function(): boolean, element: *, elseElement: *): * source
import {predicate} from 'simpledom-component'
Can be used as a simple if/else statement info your jsx :
SimpleDom.renderTo('container',
<div>
SimpleDom.predicate(myCondition,
<h1>myCondition is true</h1>,
<h1>myCondition is false</h1>
)
</div>
);
Params:
Name | Type | Attribute | Description |
cond | boolean | function(): boolean | condition to evaluate |
|
element | * | element to return if cond is true (if it's a function, the result of the function is returned). |
|
elseElement | * | element to return if cond is false (if it's a function, the result of the function is returned). |
Return:
* | element or elseElement depending of cond value. |
public renderTo(node: string | Node, elements: Array) source
import {renderTo} from 'simpledom-component'
Render some elements into a node.
public renderToDom(node: string | Node, component: Component, store: Store) source
import {renderToDom} from 'simpledom-component'
Render a component to the dom.