EventManager
The Event Manager Class stores and trigger event objects. An event object is componsed by a property called eventName which stores the event's name, and the function which will be executed at trigger time.
Kind: global class
Methods and Event
new EventManager()
Returns an instance of EventManager.
dispatch(eventName, paramX) ⇒ Object
ObjectTriggers or executes the function of the provided event's name. It received up to 10 parameters. If the event has been entered multiple times these are executed in the order or entrance.
Kind: instance method of EventManager
Returns: Object - The result Objec returned after executing the event's function.
eventName
String
The event's name
paramX
any
The function can received up to 10 parameters. From param0 to param9.
eventExists(eventName) ⇒ boolean
booleanReturns true if the provided event's name exist in the array. Otherwise returns false.
Kind: instance method of EventManager
Returns: boolean - True or false.
eventName
String
The event's name
getList() ⇒ Array
ArrayGets the array of event objects registered.
Kind: instance method of EventManager
Returns: Array - A list or event objects
on(eventName, eventFunction)
Adds an event object to the event array. An event can be added multiple times.
Kind: instance method of EventManager
eventName
String
The event's name
eventFunction
function
The function to be triggered