Handler invoked when a subscriber throws.
Dispose the instance, removing all topics and listeners.
Get the number of subscribers for a topic.
Topic name to inspect.
The number of currently registered listeners.
Checks if instance has been disposed.
True if disposed.
Publish a value to a topic asynchronously.
All listeners are invoked in the order they were added.
Delivery is scheduled with queueMicrotask.
The topic to publish.
Arguments to pass to listeners.
True if any listeners exist for this topic.
Reset the bus to its initial state without disposing it.
All topics and listeners are removed, and the instance can be reused.
Subscribe a function to a topic.
The returned function removes only this listener registration.
The topic to subscribe to.
The callback function to invoke when published.
Optionalcontext:
unknown
Optional this context for the
callback.
A function that unsubscribes this listener.
Subscribe a function to a topic only once.
Listener is removed before the first invocation.
The topic to subscribe to.
The callback function.
Optionalcontext:
unknown
Optional this context for the
callback.
A function that unsubscribes this listener.
Unsubscribe a specific function from a topic. Matches by function reference and optional context.
The topic to unsubscribe from.
The listener function.
Optionalcontext:
unknown
Optional this context.
True if the listener was found and removed.
Create a publish/subscribe event bus.
Applications usually receive the singleton instance by injecting
$eventBusinstead of constructing this class directly.