Debian Codegraph @

node/rxjs/dist/esm5/internal/scheduler/AsapAction.js

raw
1 import { __extends } from "tslib";
2 import { AsyncAction } from './AsyncAction';
3 import { immediateProvider } from './immediateProvider';
4 var AsapAction = (function (_super) {
5 __extends(AsapAction, _super);
6 function AsapAction(scheduler, work) {
7 var _this = _super.call(this, scheduler, work) || this;
8 _this.scheduler = scheduler;
9 _this.work = work;
10 return _this;
11 }
12 AsapAction.prototype.requestAsyncId = function (scheduler, id, delay) {
13 if (delay === void 0) { delay = 0; }
14 if (delay !== null && delay > 0) {
15 return _super.prototype.requestAsyncId.call(this, scheduler, id, delay);
16 }
17 scheduler.actions.push(this);
18 return scheduler._scheduled || (scheduler._scheduled = immediateProvider.setImmediate(scheduler.flush.bind(scheduler, undefined)));
19 };
20 AsapAction.prototype.recycleAsyncId = function (scheduler, id, delay) {
21 var _a;
22 if (delay === void 0) { delay = 0; }
23 if (delay != null ? delay > 0 : this.delay > 0) {
24 return _super.prototype.recycleAsyncId.call(this, scheduler, id, delay);
25 }
26 var actions = scheduler.actions;
27 if (id != null && ((_a = actions[actions.length - 1]) === null || _a === void 0 ? void 0 : _a.id) !== id) {
28 immediateProvider.clearImmediate(id);
29 if (scheduler._scheduled === id) {
30 scheduler._scheduled = undefined;
31 }
32 }
33 return undefined;
34 };
35 return AsapAction;
36 }(AsyncAction));
37 export { AsapAction };
38 //# sourceMappingURL=AsapAction.js.map