EventInfo
class
The event object passed to event callbacks. It is used to provide information about the event as well as a tool to manipulate it.
Type parameters
-
TName : extends string = string -
TReturn : unknown
Properties
-
name : TNamereadonlymodule:utils/eventinfo~EventInfo#nameThe event name.
-
off : () => voidreadonlymodule:utils/eventinfo~EventInfo#offRemoves the current callback from future interactions of this event.
-
path : Array<object>module:utils/eventinfo~EventInfo#pathPath this event has followed. See
delegate. -
return : undefined | TReturnmodule:utils/eventinfo~EventInfo#returnThe value which will be returned by
fire.It's
undefinedby default and can be changed by an event listener:dataController.fire( 'getSelectedContent', ( evt ) => { // This listener will make `dataController.fire( 'getSelectedContent' )` // always return an empty DocumentFragment. evt.return = new DocumentFragment(); // Make sure no other listeners are executed. evt.stop(); } );Copy code -
source : objectreadonlymodule:utils/eventinfo~EventInfo#sourceThe object that fired the event.
-
stop : () => voidreadonlymodule:utils/eventinfo~EventInfo#stopStops the event emitter to call further callbacks for this event interaction.
Methods
-
constructor( source, name )module:utils/eventinfo~EventInfo#constructorType parameters
TName : extends string = stringTReturn : unknown
Parameters
source : objectThe emitter.
name : TNameThe event name.