Alias of LokiEventEmitter.prototype.on addListener(eventName, listener) - adds a listener to the queue of callbacks associated to an event
the index of the callback in the array of listeners for a particular event
LokiEventEmitter
the name(s) of the event(s) to listen to
callback function of listener to attach
boolean determines whether or not the callbacks associated with each event should happen in an async fashion or not Default is false, which means events are synchronous
LokiEventEmitter
a hashmap, with each property being an array of callbacks
LokiEventEmitter
emit(eventName, data) - emits a particular event with the option of passing optional parameters which are going to be processed by the callback provided signatures match (i.e. if passing emit(event, arg0, arg1) the listener should take two parameters)
LokiEventEmitter
the name of the event
Optional
data: unknownoptional object passed with the event
Optional
arg: anyon(eventName, listener) - adds a listener to the queue of callbacks associated to an event
the index of the callback in the array of listeners for a particular event
LokiEventEmitter
the name(s) of the event(s) to listen to
callback function of listener to attach
removeListener() - removes the listener at position 'index' from the event 'eventName'
LokiEventEmitter
the name(s) of the event(s) which the listener is attached to
the listener callback function to remove from emitter
Rest
...args: any[]Generated using TypeDoc
LokiEventEmitter is a minimalist version of EventEmitter. It enables any constructor that inherits EventEmitter to emit events and trigger listeners that have been added to the event through the on(event, callback) method