Class EventMapTree

Construct a tree root when invoked without any arguments. Children nodes are constructred internally as needed on calls to addListener()

Param: parent

Param: segment

Constructors

  • Parameters

    Returns EventMapTree

Properties

children: any
listener: any
parent?: EventMapTree
segment?: string

Methods

  • Remove all listeners and descendent listeners for a path location. Return the node for the path location if any

    Parameters

    Returns this

  • Remove the listener at a path location and return it

    Parameters

    Returns any

    previous

  • Remove the reference to this node from its parent so that it can be garbage collected. This is called internally when all listener to a node are removed

    Returns void

  • Call the callback with each listener to the node and its decendants

    Parameters

    • callback: any

    Returns void

  • Return an array with each of the listeners that may be affected by a change to segments. These are:

    1. Listeners to each node from the root to the node for segments
    2. Listeners to all descendent nodes under segments

    Parameters

    • segments: any

    Returns any[]

    listeners

  • Return the direct listener to segments if any

    Parameters

    Returns any

    listeners

  • Assign a listener to a path location. Listener may be any type of value. Return the previous listener value if any

    Parameters

    Returns any

    previous