Constructs a utility that allows emitting events and registering event handlers.
OptionalsupportedEvents: string[]The list of event names that can be emitted
OptionalstrictMode: booleanif true, any attempt to register a handler for an event not included in
supportedEvents will throw an error.
Emits an event. Invokes all registered callbacks for the specified event type. Any additional parameters passed to this method are forwarded as arguments to the registered callback functions.
the event type to emit
additional parameters that describe the emitted event
Registers a callback function for a given event type.
the event type to register on
the callback function to register
Optionalcontext: 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.
StaticonRegisters a callback function on the specified target object for a given event type.
the target object
the event type to register on
the callback function to register
Optionalcontext: 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.
StaticonceRegisters a callback function on the specified target object for a given event type. This function behaves identical to 'on' with the exception that the registered callback function will be automatically removed when it has been triggered one time.
the target object
the event type to register on
the callback function to register
Optionalcontext: 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.
A utility class for objects that emit events and allow listeners to be registered.
EventedSupportcan be used in a class’s prototype chain to wire in an event notification system. For example, you can implement a custom Store and useEventedSupportto emit store-specific events.