Global

Methods

aggregatingEventEmitter(optionsopt) → {EventEmitter}

Find an existing event emitter by name or create a new one. Named event emitters will always return the first instance created when fetched by name unless they've been specifically deleted using the removeNamedEventEmitter or removeNamedEventEmitters functions. If no name is provided, an anonymous event emitter that cannot be fetched again will be created.
Parameters:
Name Type Attributes Description
options options <optional>
The options to set for the event emitter (ignored if an event emitter by that name already exists).
Properties
Name Type Attributes Description
name string <optional>
The name of the event emitter to get or create.
Source:
Returns:
The event emitter associated with the name provided (or an anonymous one if a name is not provided).
Type
EventEmitter

AggregatingEventEmitter()

Source:
See:

removeNamedEventEmitter(name) → {boolean}

Remove an existing event emitter by name. This will not stop the event emitter from functioning, only from being returned from aggregatingEventEmitter.
Parameters:
Name Type Description
name string The name of the event emitter to remove the reference to.
Source:
Returns:
True if the event emitter existed (and was removed), false otherwise.
Type
boolean

removeNamedEventEmitters()

Remove all existing event emitters. This will not stop the event emitters from functioning, only from being returned from aggregatingEventEmitter.
Source:

Type Definitions

options

The options that can set on an event emitter when it is created.
Type:
  • object
Properties:
Name Type Attributes Default Description
wildcards boolean <optional>
false Whether or not to enable wildcard matching in event names (e.g., "data.*" to match "data.get").
listOptions boolean <optional>
false Whether or not to enable list option matching in event names. (e.g., "data.{get,set}" to match both "data.get" and "data.set").
hooks boolean | array <optional>
false

False to disable hooks, or an array to specify lifecycle hooks (in order) to allow handlers to register against. E.g., if passing in ['first', 'before', 'default' 'after', 'last'] any handler registered as "namespace.event" will be in the "default" lifecycle, which will happen after those registered as "first:namespace.event" or "before:namespace.event".

If a "default" is not provided, an error will be raised if any handler is registered without a lifecycle marker. If the value true is provided instead of an array, the default lifecycles will be used (["early", "before", "default", "after", "late"]).

NOT YET IMPLEMENTED

Source: