UNPKG

rxjs

Version:

Reactive Extensions for modern JavaScript

37 lines 1.15 kB
import { __extends } from "tslib"; import { Scheduler } from '../Scheduler'; var AsyncScheduler = (function (_super) { __extends(AsyncScheduler, _super); function AsyncScheduler(SchedulerAction, now) { if (now === void 0) { now = Scheduler.now; } var _this = _super.call(this, SchedulerAction, now) || this; _this.actions = []; _this.active = false; _this.scheduled = undefined; return _this; } AsyncScheduler.prototype.flush = function (action) { var actions = this.actions; if (this.active) { actions.push(action); return; } var error; this.active = true; do { if (error = action.execute(action.state, action.delay)) { break; } } while (action = actions.shift()); this.active = false; if (error) { while (action = actions.shift()) { action.unsubscribe(); } throw error; } }; return AsyncScheduler; }(Scheduler)); export { AsyncScheduler }; //# sourceMappingURL=AsyncScheduler.js.map