Event Handle that is created by EventHandler and can be used for easier event removal and management.

const evt = obj.on('test', (a, b) => {
console.log(a + b);
});
obj.fire('test');

evt.off(); // easy way to remove this event
obj.fire('test'); // this will not trigger an event
// store an array of event handles
let events = [ ];

events.push(objA.on('testA', () => { }));
events.push(objB.on('testB', () => { }));

// when needed, remove all events
events.forEach((evt) => {
evt.off();
});
events = [ ];

Constructors

Accessors

Methods

Constructors

Accessors

Methods