Class

DataNode

DataNode()

DataNode This class stores keys-values pairs and allows to subscribe for any changes of this data.

Constructor

# new DataNode()

View Source data/DataNode.js, line 7

Methods

# _setObserver(key, val)

Set an observer given a key and a value.

Parameters:
Name Type Description
key string

Property name.

val *

Value of the property.

View Source data/DataNode.js, line 84

# append(node)

Append a DataNode to this DataNode.

Parameters:
Name Type Description
node DataNode

DataNode to append.

View Source data/DataNode.js, line 21

# find(id)

Find a children DataNode by the id.

Parameters:
Name Type Description
id string

Id of the DataNode.

View Source data/DataNode.js, line 60

# get(key, defaultValue)

Get the value for key, if not exists go to parent node to get it until root node.

Parameters:
Name Type Default Description
key string
defaultValue * null

Default value.

View Source data/DataNode.js, line 48

# set(…key)

Set property to the node.

Parameters:
Name Type Attributes Description
key args <repeatable>

It accepts 2 parameters with key and value or an array with objects.

View Source data/DataNode.js, line 32

# subscribe(prop, func)

Subscribe function to property.

Parameters:
Name Type Description
prop string

Property to subscribe.

func function

Function to launch.

View Source data/DataNode.js, line 74