ste-core
Version:
Core files for the Strongly Typed Events project.
33 lines (32 loc) • 789 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.EventManagement = void 0;
/**
* Allows the user to interact with the event.
*
* @export
* @class EventManagement
* @implements {IEventManagement}
*/
class EventManagement {
/**
* Creates an instance of EventManagement.
* @param {() => void} unsub An unsubscribe handler.
*
* @memberOf EventManagement
*/
constructor(unsub) {
this.unsub = unsub;
this.propagationStopped = false;
}
/**
* Stops the propagation of the event.
* Cannot be used when async dispatch is done.
*
* @memberOf EventManagement
*/
stopPropagation() {
this.propagationStopped = true;
}
}
exports.EventManagement = EventManagement;
;