BeEvent<T extends Listener> Class

Manages a set of listeners for a particular event and notifies them when the event is raised. This class is usually instantiated inside of a container class and exposed as a property for others to subscribe via BeEvent.addListener.

Extended by

Methods

Name Description
addListener(listener: T extends Listener, scope?: any): () => void Registers a Listener to be executed whenever this event is raised.  
addOnce(listener: T extends Listener, scope?: any): () => void Registers a callback function to be executed only once when the event is raised.  
clear(): void Clear all Listeners from this BeEvent.  
has(listener: T extends Listener, scope?: any): boolean Determine whether this BeEvent has a specified listener registered.  
raiseEvent(...args: any[]): void Raises the event by calling each registered listener with the supplied arguments.  
removeListener(listener: T extends Listener, scope?: any): boolean Un-register a previously registered listener.  

Properties

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

Defined in

Last Updated: 23 April, 2020