Registers a callback function for a given event type.
the event type to register on
the callback function to register
Rest
...args: any[]Optional
context: anythe context in which the callback function should be invoked implementation dependent.
a handle to the registered callback with a single function 'remove'. This function can be used to unregister the callback function.
An interface allows to register listeners for objects that emit events. If you have a custom class that emits events, you may want to consider using
Evented
with EventedSupport.