Eventable
Implemented by
Index
Methods
emit
Parameters
eventName: string
The name of the event to publish
event: any
Optionally pass an event data object to the handler
Returns void
off
Unsubscribe an event handler(s) from an event. If a specific handler is specified for an event, only that handler will be unsubscribed. Otherwise all handlers will be unsubscribed for that event.
Parameters
eventName: string
The name of the event to unsubscribe
optionalhandler: Handler<any>
Optionally the specific handler to unsubscribe
Returns void
on
Subscribe an event handler to a particular event name, multiple handlers per event name are allowed.
Parameters
eventName: string
The name of the event to subscribe to
handler: Handler<any>
The handler callback to fire on this event
Returns void
once
Once listens to an event once then auto unsubscribes from that event
Parameters
eventName: string
The name of the event to subscribe to once
handler: Handler<any>
The handler of the event that will be auto unsubscribed
Returns void
Emits an event for target