Create a new event.
the parent that will be passed to listener as their this
Optional
options: AsyncEventOptionsoptions for this event
Readonly
subscribablePublic 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
Create a subscribable that will apply the specified filter to any listeners added.
function used to filter events
Rest
...args: Argsfiltered AsyncSubscribable
Create an iterator that supports async iteration of events emitted.
Optional
options: EventIteratorOptionsoptions for this iterator
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.
function used to monitor for changes to listeners
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 ErrorStrategy and will instead reject if an error occurs.
Rest
...args: Argsarguments that the listeners will receive
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.
listener to subscribe
handle to the subscription, can be used to unsubscribe. Resolves when the subscription is fully registered
Protected
subscribe0Subscribe to this event using the given listener. The listener will be invoked any time the event is emitted.
listener to subscribe
promise
Unsubscribe a listener from this handler. The specified listener will no longer be invoked when the event is emitted.
listener to unsubscribe
promise that resolves when the listener is fully unsubscribed
Protected
unsubscribe0Unsubscribe a listener from this handler. The specified listener will no longer be invoked when the event is emitted.
listener to unsubscribe
promise that resolves when the listener is removed
Create a Subscribable that changes the this argument used for listeners.
what should be treated as this for event 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: