Class

Events

Events(propsopt)

Event emitter with wild card support and delimited entries.
Constructor

# new Events(propsopt)

Constructs an event emitter
Parameters:
Name Type Attributes Description
props ConstructorParams <optional>
parameters to configure the emitter

View Source emitter.js, line 56

Classes

Events

Methods

# emit(event, …params) → {Array.<any>}

Emits an event synchronously
Parameters:
Name Type Attributes Description
event string the event to emit
params params <repeatable>
the parameters to call the event with

View Source emitter.js, line 196

- an array of the parameters the event was called with
Array.<any>

# async emitAsync(event, …params) → {Array.<any>}

Emits events asynchronously, in order, sequentially
Parameters:
Name Type Attributes Description
event string the event to emit
params params <repeatable>
the parameters to call the event with

View Source emitter.js, line 212

- an array of the parameters the event was called with
Array.<any>

# async emitAtOnce(event, …params) → {Array.<any>}

Emits events asynchronously, in parallel
Parameters:
Name Type Attributes Description
event string the event to emit
params params <repeatable>
the parameters to call the event with

View Source emitter.js, line 228

- an array of the parameters the event was called with
Array.<any>

# off(names, handleropt)

Removes a listener from a pattern
Parameters:
Name Type Attributes Description
names string | Array.<string> the pattern(s) of the handler to remove
handler function <optional>
the handler to remove, or all handlers

View Source emitter.js, line 124

# on(names, handler)

Adds an event listener with wildcards etc
Parameters:
Name Type Description
names string | Array.<string> the event patterns to handle
handler function the handler for the pattern

View Source emitter.js, line 79

# once(name, handler)

Add an event listener that will fire only once, if multiple patterns are provided it will only fire on the first one
Parameters:
Name Type Description
name string | Array.<string> the event pattern to listen for
handler function the function to invoke

View Source emitter.js, line 109