Class: MyEventEmitter

MyEventEmitter()

A simple event emitter class. Objects that inheret this class or implement it can then bubble events up to the UI similar to existings event emitter such as 'onChange' or 'onClick'

Constructor

new MyEventEmitter()

Default constructor, intializes an empty object to store events
Source:

Methods

emit(name, data)

The internal API for this class. Gets called with an event name and a data object. Any callbacks that have been set to listen to the matching event are dispatched.
Parameters:
Name Type Description
name *
data *
Source:

on(name, listener)

The external API for this class. Gets called with an event name and a callback function that is fired when the event is emitted.
Parameters:
Name Type Description
name *
listener *
Source:

removeListener(name, listenerToRemove)

Function to remove a listener that was previously set
Parameters:
Name Type Description
name *
listenerToRemove *
Source: