rogain-resolve-tree
Resolve rogain tree with given data into simple dom tree. The output dom tree is useful for render to string or diffing sets of trees.
Example
;; var currentTreeState = ;
resolveTree(tree, props, options)
Resolves a rogain tree into a simple dom tree with a given set of properies.
tree
Object in Rogain tree format.
props
Object.
options
options.components
optional rogain-registry
instance. defines components used in resolution.
Output
The output of the resolveTree function will be a basic dom tree.
Input Rogain Template
Friend Component
{@attrs.data.lastName}, {@attrs.data.firstName}
Input Data Object
friends: firstName: 'Ben' lastName: 'Forester' firstName: 'Larry' lastName: 'Forman'
Output Tree
type: 'tag' name: 'h2' children: 'Forester, Ben' type: 'tag' name: 'h2' children: 'Forman, Larry'
Install
With npm do:
npm install rogain-resolve-tree
License
MIT