Class: Emitter

Emitter

new Emitter(options)

Custom event emitter implementation, that extends EventEmitter3
Parameters:
Name Type Argument Default Description
options Object <optional>
{} configuration options
Source:

Extends

  • external:EventEmitter3

Members

_anyListeners

List of listeners for any event
Source:

_emitterId

Generated unique id for the Emitter. This is to help with debugging when multiple Emitter instances are being used
Source:

_wildcard

Wildcard for subscribing to any event
Source:

defaultOptions

Default options for the Emitter instance.
Source:

Methods

emit(typeOrDecksEvent, data) → {boolean}

Overrides the EventEmitter3 emit method to support a single DecksEvent argument, which contains the event type as a property, along with other properties.
Parameters:
Name Type Argument Description
typeOrDecksEvent String | DecksEvent event type String, or DecksEvent instance.
data * <repeatable>
if the first argument is a String, the remaining arguments are emitted as the event data. This argument is N/A if the first argument is a DecksEvent instance.
Source:
Returns:
- true if at least one handler was invoked for the event, otherwise false
Type
boolean

off(event, fn, context) → {undefined}

Wraps the super "off" method, and adds support for using event "*" to unsubscribe from any event.
Parameters:
Name Type Description
event String event name or "*"
fn function callback function
context * context for callback function
Source:
Returns:
Type
undefined

offAny()

Extension to EventEmitter3 to unsubscribe from any event.
Source:

on(event, fn, context) → {undefined}

Wraps the super "on" method, and adds support for using event "*" to subscribe to any event.
Parameters:
Name Type Description
event String event name or "*"
fn function event listener callback function
context * context to use for invoking callback function
Source:
Returns:
Type
undefined

onAny()

Extension to EventEmitter3 to subscribe to any event.
Source: