UNPKG

ste-core

Version:
33 lines (32 loc) 789 B
"use strict"; 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;