# 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 |
- Source:
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 |
- Source:
# addCallback(event)
adds a callback to this events callbacks
Parameters:
Name | Type | Description |
---|---|---|
event |
Event | the event to add |
- Source:
# addSubEvent(name)
adds a sub EventHolder
Parameters:
Name | Type | Description |
---|---|---|
name |
string | the name of the subevent to add |
- Source:
# 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 |
- Source:
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 |
- Source:
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 |
- Source: