registerListener<T>(eventTypes, listener, nodeID?, observeSubTree?): number
Registers the listener to the node with the matching nodeID and returns
the id of the listener. The observeSubTree flag allows to observe the whole subtree under the
respective node with the listener. With the eventTypes array, you can specify the
types of events the listener should be reacting on. If an empty array is passed, the listener will react on
all event types.
These functions allow adding and removing listeners to be able to react to events on arbitrary nodes.
Example