A simple event emitter interface used to implement the observer pattern throughout the codebase.
Signature:
export interface Emitter<E extends EventsType>
Method | Description |
---|---|
addEventListener(eventName, listener) | Add a listener to a specific event. |
once(eventName) | Add a listener to a specific event, that will only be invoked once |
removeEventListener(eventName, listener) | Remove a listener from a specific event. |