EventEmitter

EventEmitter

Mixin that provides functions for event handling.

See 05_events for usage examples.

Methods

addListener(event, callback, context)

Add a listener for a given event.

Parameters:
Name Type Description
event String

The event name.

callback function

The listener function.

context Object

the context to invoke the listener with.

removeListener(event, callback, context)

Remove a listener for a given event.

Parameters:
Name Type Description
event String

The event name.

callback function

Only remove the listeners that match this function.

context Object

Only remove the listeners that have this context.