EventHolder

EventHolder

# new EventHolder()

holds events and further sub event holders
Properties
Name Type Description
callbacks Array.<function()> array of callback function to be used called when the event is triggered
allSubCallbacks Array.<function()> array of all callbacks functions in this EventHolder and all subEventHolders
subEvents object gets the subevents

Methods

# add(path, event)

adds an event to this event holder of a sub event holder
Parameters:
Name Type Description
path Array.<string> the path to the event
event Event the event to add

# addCallback(event)

adds a callback to this events callbacks
Parameters:
Name Type Description
event Event the event to add

# addSubEvent(name)

adds a sub EventHolder
Parameters:
Name Type Description
name string the name of the subevent to add

# getCallbacks(path) → {Array.<function()>}

gets the callbacks from the path, will call sub event holders to get events
Parameters:
Name Type Description
path Array.<string> path the the event
Returns:
- the callbacks
Type
Array.<function()>

# getSubEvent(name) → {EventHolder}

returns the subEvent from the name passed in
Parameters:
Name Type Description
name string the name of the sub event to return
Returns:
- the sub event holder
Type
EventHolder

# remove(path, event)

removes a event from the event holder
Parameters:
Name Type Description
path Array.<string> path to event
event Event the event to remove