goog.ds.DataNode | |
goog.ds.DataManager | goog.ds.DataNode |
![]()
Add a data source
Arguments:
|
code » | ||||||
![]()
Adds an indexed listener.
Indexed listeners allow for '*' in data paths. If a * exists, will match
all values and return the matched values in an array to the callback.
Currently uses a promiscuous match algorithm: Matches everything before the
first '*', and then does a regex match for all of the returned events.
Although this isn't optimized, it is still an improvement as you can collapse
100's of listeners into a single regex match
|
code » | ||||||
![]()
Adds a listener
Listeners should fire when any data with path that has dataPath as substring
is changed.
TODO(user) Look into better listener handling
|
code » | ||||||
![]()
Create an alias for a data path, very similar to assigning a variable.
For example, you can set $CurrentContact -> $Request/Contacts[5], and all
references to $CurrentContact will be procesed on $Request/Contacts[5].
Aliases will hide datasources of the same name.
|
code » | ||||||
![]()
Fire a data change event to all listeners
If the path matches the path of a listener, the listener will fire
If your path is the parent of a listener, the listener will fire. I.e.
if $Contacts/bob@bob.com changes, then we will fire listener for
$Contacts/bob@bob.com/Name as well, as the assumption is that when
a parent changes, all children are invalidated.
If your path is the child of a listener, the listener may fire, depending
on the ancestor depth.
A listener for $Contacts might only be interested if the contact name changes
(i.e. $Contacts doesn't fire on $Contacts/bob@bob.com/Name),
while a listener for a specific contact might
(i.e. $Contacts/bob@bob.com would fire on $Contacts/bob@bob.com/Name).
Adding "/..." to a lisetener path listens to all children, and adding "/*" to
a listener path listens only to direct children
Arguments:
|
code » | ||||||
Get the value of the node
Returns: !Object
The value of the node.
|
code » | ||||||
Gets a named child node of the current node
Arguments:
Returns: goog.ds.DataNode
The child node,
or null if no node of this name exists.
|
code » | ||||||
![]()
No description.
|
code » | ||||||
![]()
No description.
|
code » | ||||||
Get the name of the node relative to the parent node
Returns: string
The name of the node.
|
code » | ||||||
Gets the a qualified data path to this node
Returns: string
The data path.
|
code » | ||||||
Gets a named child node of the current node.
Arguments:
Returns: goog.ds.DataNode
The child node,
or null if no node of this name exists.
|
code » | ||||||
Get the total count of events fired (mostly for debugging)
Returns: number
Count of events.
|
code » | ||||||
Get the total number of listeners (per expression listened to, so may be
more than number of times addListener() has been called
Returns: number
Number of listeners.
|
code » | ||||||
![]()
Gets the state of the backing data for this node
Returns: goog.ds.LoadState
The state.
|
code » | ||||||
Whether the value of this node is a homogeneous list of data
Returns: boolean
True if a list.
|
code » | ||||||
![]()
Listener function for matches of paths that have been aliased.
Fires a data change on the alias as well.
|
code » | ||||||
![]()
Load or reload the backing data for this node
only loads datasources flagged with autoload
|
code » | ||||||
![]()
Removes indexed listeners with a given callback function, and optional
matching datapath and matching id.
Arguments:
|
code » | ||||||
![]()
Removes listeners with a given callback function, and optional
matching dataPath and matching id
Arguments:
|
code » | ||||||
![]()
Removes listeners with a given callback function, and optional
matching dataPath and matching id from the given listenersByFunction
data structure.
Arguments:
|
code » | ||||||
![]()
Disables the sending of all data events during the execution of the given
callback. This provides a way to avoid useless notifications of small changes
when you will eventually send a data event manually that encompasses them
all.
Note that this function can not be called reentrantly.
Arguments:
|
code » | ||||||
![]()
No description.
|
code » |
![]()
Get the value of the node
Arguments:
Returns: *
The value of the node, or null if no value.
|
code » | |||
Gets a named child node of the current node
Arguments:
Returns: goog.ds.DataNode
The child node, or null
if no node of this name exists.
|
code » | |||
![]()
Gets the value of a child node
Arguments:
Returns: *
The value of the node, or null if no value or the child node
doesn't exist.
|
code » | |||
Gets all of the child nodes of the current node.
Should return an empty DataNode list if no child nodes.
Arguments:
Returns: !goog.ds.DataNodeList
The child nodes.
|
code » | |||
Get the name of the node relative to the parent node
Returns: string
The name of the node.
|
code » | |||
Gets the a qualified data path to this node
Returns: string
The data path.
|
code » | |||
![]()
Gets the state of the backing data for this node
Returns: goog.ds.LoadState
The state.
|
code » | |||
Whether the value of this node is a homogeneous list of data
Returns: boolean
True if a list.
|
code » | |||
![]()
Set the value of the node
Arguments:
|
code » | |||
Sets a named child node of the current node.
|
code » | |||
![]()
Set the name of the node relative to the parent node
Arguments:
|
code » |
![]()
Load or reload the backing data for this node
|
Code » |
![]()
Clears the global instance (for unit tests to reset state).
|
code » | |
Get the global instance
Returns: !goog.ds.DataManager
The data manager singleton.
|
code » |