BeUnorderedEvent<T extends Listener> Class @beta

Manages a set of listeners for a particular event and notifies them when the event is raised. Unlike BeEvent, this class uses a Set internally to support safe concurrent modification during emit. When a listener is removed during emit, it is marked for deferred removal instead of mutating the set immediately.

Listeners are managed exclusively through the disposal closure returned by addListener and addOnce. There is no removeListener or has method — callers must capture the returned closure to unsubscribe.

Extended by

Methods

Name Description
constructor<T extends Listener>(): BeUnorderedEvent<T>    
addListener(listener: T, scope?: any): () => void Registers a Listener to be executed whenever this event is raised.  
addOnce(listener: T, scope?: any): () => void Registers a callback function to be executed only once when the event is raised.  
clear(): void Clear all listeners from this BeUnorderedEvent.  
raiseEvent(...args: Parameters<T>): void Raises the event by calling each registered listener with the supplied arguments.  

Properties

Name Type Description
numberOfListeners Accessor ReadOnly number The number of listeners currently subscribed to the event.  

Defined in

Last Updated: 18 April, 2026