UNPKG

ng2-idle-core

Version:

ng-idle for Angular 2+ core module

69 lines 1.82 kB
/* * A class for managing an interrupt from an interrupt source. */ var /* * A class for managing an interrupt from an interrupt source. */ Interrupt = /** @class */ (function () { function Interrupt(source) { this.source = source; } /* * Subscribes to the interrupt using the specified function. * @param fn - The subscription function. */ /* * Subscribes to the interrupt using the specified function. * @param fn - The subscription function. */ Interrupt.prototype.subscribe = /* * Subscribes to the interrupt using the specified function. * @param fn - The subscription function. */ function (fn) { this.sub = this.source.onInterrupt.subscribe(fn); }; /* * Unsubscribes the interrupt. */ /* * Unsubscribes the interrupt. */ Interrupt.prototype.unsubscribe = /* * Unsubscribes the interrupt. */ function () { this.sub.unsubscribe(); this.sub = null; }; /* * Keeps the subscription but resumes interrupt events. */ /* * Keeps the subscription but resumes interrupt events. */ Interrupt.prototype.resume = /* * Keeps the subscription but resumes interrupt events. */ function () { this.source.attach(); }; /* * Keeps the subscription but pauses interrupt events. */ /* * Keeps the subscription but pauses interrupt events. */ Interrupt.prototype.pause = /* * Keeps the subscription but pauses interrupt events. */ function () { this.source.detach(); }; return Interrupt; }()); /* * A class for managing an interrupt from an interrupt source. */ export { Interrupt }; //# sourceMappingURL=interrupt.js.map