Event type
Optionallistener: (event: TData) => voidEvent listener
Add new event listener
Event type. If the event type is xAPI, the listener's event parameter will be of type XAPIEvent. Any dispatched XAPIEvent will trigger the xAPI event.
Event listener
OptionalthisArg: ThisType<unknown>Optionally specify the listener's this value
Add new event listener that will be fired only once
Event type. If the event type is xAPI, the listener's event parameter will be of type XAPIEvent. Any dispatched XAPIEvent will trigger the xAPI event.
Event listener
OptionalthisArg: ThisType<unknown>Optionally specify the listener's this value
Dispatch event
Event object or event type as string
OptionaleventData: TDataCustom event data (used when event type as string is used as first argument)
Optionalextras: { bubbles?: boolean; external?: boolean }
Remove event listener If no listener is specified, all listeners will be removed