Creates a new Event, with its emit accessible as a member function.
Emits a value to all the listeners, triggering their callbacks. Returns true if the event had listeners emitted to, false otherwise. Because this exists on the event, any code with access to this event can trigger the callback for all listeners.
Removes a callback from this event (regardless of once vs on).
Returns true if a callback was removed, false otherwise.
The callback to remove.
True if a callback was removed, false otherwise.
Removes ALL callbacks from this event, regardless of once vs on.
Returns the number of listeners removed.
The number of listeners removed.
Attaches a callback to trigger on all emits for this event.
The callback to invoke on all emits.
Attaches a callback to trigger on only the first emit for this event. After that event is emitted this callback will automatically be removed.
The callback to invoke only the next time this event emits, then that callback is removed from this event.
Attaches a callback to trigger on only the first emit for this event.
Returns a promise that resolves with the emitted data the next time this event is triggered (only once).
A promise that resolves with the emitted data the next time this event is triggered (only once).
Generated using TypeDoc
A specialized Event that holds a reference to its own emit function. This allows any code with access to the Event to also trigger emits.