An interface for Events that can send asynchronious notifications to multiple subscribed listeners.
Implements: INotifiable
Description
The IEvent interface allows you to define events that can send asynchronous notifications to multiple subscribed listeners.
Methods
Name
Gets the event’s name.
Name() string
- returns: string - name of the event.
getListeners
Gets all subscribed listeners.
Listeners() []IEventListener
- returns: []IEventListener - list of listeners.
AddListener
Adds a listener to receive notifications for this event.
AddListener(listener IEventListener)
- listener: IEventListener - listener reference to add.
RemoveListener
Removes a listener, so that it no longer receives notifications for this event.
RemoveListener(listener IEventListener)
- listener: IEventListener - listener reference to remove.