Create a new event.
this
Public AsyncSubscribable that can safely be shared with consumers that should be able to listen for events.
Get if there are any listeners available.
true
if listeners are present
Get a copy of the listeners as an array.
listeners as array
Return an async iterator for this event.
async iterator for this event
Clear all listeners for this event.
Emit this event. This will invoke all of the listeners with the passed arguments.
Create a subscribable that will apply the specified filter to any listeners added.
filtered AsyncSubscribable
Create an iterator that supports async iteration of events emitted.
iterable/iterator
Monitor for changes to listeners. Only a single monitor is supported at a single time. This is intended to be used to react to if listeners are currently registered. This can be used for things such as only listening to events from other objects when this event is active.
Get a promise that will resolve the first time this event is fired after this call.
listener that resolves the next time the event is emitted
Emit this event in parallel. This will invoke all of the listeners with the passed arguments. Triggering of the listeners will done in parallel.
This method will not use the current {@link ErrorStrategy} and will instead reject if an error occurs.
Stop monitoring for listener changes.
Subscribe to this event using the given listener. The listener will be invoked any time the event is emitted. The returned handle can be used to unsubscribe.
handle to the subscription, can be used to unsubscribe. Resolves when the subscription is fully registered
Subscribe to this event using the given listener. The listener will be invoked any time the event is emitted.
promise
Unsubscribe a listener from this handler. The specified listener will no longer be invoked when the event is emitted.
promise that resolves when the listener is fully unsubscribed
Unsubscribe a listener from this handler. The specified listener will no longer be invoked when the event is emitted.
promise that resolves when the listener is removed
Create a Subscribable that changes the this argument used for listeners.
modified AsyncSubscribable
Generated using TypeDoc
An event that handles subscription in an asynchronous way.
Each instance represents a single event:
The event can be emitted via the
emit
method:Listeners can be added directly on the event, but it is recommended to use
.subscribable
for any API that is public:Listeners can be unsubscribed either via their handle or via the event: