Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • EventEmitter

Index

Constructors

constructor

  • Constructor

    Parameters

    • Optional emitAsCallback: boolean

      If set to true, the callbacks will receive the arguments as function arguments, instead of a single event object

    Returns EventEmitter

Properties

Protected emitAsCallback

emitAsCallback: boolean

If true the emitter will emit the event as callback and not using the event object

Protected events

events: PlainObject<{ listener: EventEmitterCallbackEventListener | EventEmitterEventListener; priority: number }[]>

The list of events that are registered in this emitter

Methods

bind

emit

emitHook

  • Hooks are quite similar to events and share the same namespace with them. They however have one distinct difference when it comes to their handling. Events are called async, you emit an event and go on. A hook however waits for the registered listeners to finish and allows them to process the given arguments. All listeners are executed in sequence, even if they are async and return a promise object.

    Therefore this method will always return a promise object you have to wait for.

    Parameters

    Returns Promise<PlainObject<any>>

unbind

unbindAll

Generated using TypeDoc