Subscribes one or more listeners to events. The same listener can only be registered once per event - duplicate registrations are ignored.
Single event name or array of event names to subscribe to
Callback function or object to invoke when events are dispatched
Returns a Promise that resolves when an event is dispatched. Useful for one-time event waiting without creating persistent listeners.
The event name to wait for
A Promise that resolves with the event when it is dispatched
The dispatch method is used for dispatching a BaseEvent.
Subscribes a listener to an event that automatically unsubscribes after the first occurrence.
The event name to subscribe to
Callback function or object to invoke when the event is dispatched
Unsubscribes one or more listeners from events. Removing a listener that was not registered is a no-op.
Single event name or array of event names to unsubscribe from
The listener callback to remove
The subscribe method is used for listening to one or more BaseEvent and it returns a cleanup function that removes listener when called.
The same listener can only be added once for a specific event. Adding the same listener multiple times will have no effect and nothing will occur.
Subscribes a listener to an event once and returns a cleanup function. The listener is automatically removed after the first event occurrence.
The event name to subscribe to
Callback function or object to invoke when the event is dispatched
A cleanup function that removes the listener when called
EventBusclass can be derived from anyIEventBusAdapter.IMPORT_PATH:
"@daiso-tech/core/event-bus"