Class: exports

exports()

This takes the node.js 'events' package and adds the following functionality: - Registration/unregistration of events. Events cannot be emitted until registered. - Pausing / Resuming event emission. Paused events will be added to a queue, and can be optionally emitted at resumption of events. - Relaying of events from one object to another. A relayed event will appear to be emitted from the relaying object, not from the origin object.

Constructor

new exports()

Source:

Members

addListeners

Adds the same listener to multiple events. Usage: - const events = ['foo', 'bar']; - const handler = () => {}; - emitter.addListeners(events, handler);
Source:

getRegisteredEvents

Gets array of names of all registered event types.
Source:

ons

Alias for addListeners
Source:

pauseEvents

Pauses all events. Chainable. Any events emitted while paused will be added to a queue.
Source:

registerEvent

Registers a single event type to be used by this Class. Events must be registered before they can be emitted.
Source:

registerEvents

Registers multiple event types to be used by this Class. Events must be registered before they can be emitted.
Source:

relayEventsFrom

Relays events from one object to another. A relayed event will appear to be emitted from the relaying object (this), not from the origin object.
Source:

resumeEvents

Resumes all events. Chainable.
Source:

unregisterEvent

Unregisters a single event type from use in this Class.
Source:

unregisterEvents

Unregisters multiple event types from use in this Class. Events must be registered before they can be emitted.
Source: