An interface for Events that can send asynchronious notifications to multiple subscribed listeners.
Extends: INotifiable
Description
The IEvent interface allows you to define events that can send asynchronous notifications to multiple subscribed listeners.
Instance methods
getName
Gets the event name.
getName(): string
- returns: string - name of the event.
getListeners
Gets all subscribed listeners.
getListeners(): IEventListener[]
- returns: IEventListener[] - list of listeners.
addListener
Adds a listener to receive notifications for this event.
addListener(listener: IEventListener): void
- listener: IEventListener - listener reference to add.
removeListener
Removes a listener, so that it no longer receives notifications for this event.
removeListener(listener: IEventListener): void
- listener: IEventListener - listener reference to remove.