lavva.exalushome
Version:
Library implementing communication and abstraction layers for ExalusHome system
19 lines • 594 B
JavaScript
import { TypedEvent } from './TypedEvent';
export class CancelationTokenSource {
constructor() {
this._canceled = false;
this._cancellationRequested = false;
this.CancellationEvent = new TypedEvent();
}
Cancel() {
if (this._cancellationRequested)
throw Error("Cancelation has already been requested.");
this._cancellationRequested = true;
this.CancellationEvent.Invoke();
this._canceled = true;
}
get IsCancelled() {
return this._canceled;
}
}
//# sourceMappingURL=CancelationTokenSource.js.map