1 /** PURE_IMPORTS_START tslib,_util_Immediate,_AsyncAction PURE_IMPORTS_END */
2 import * as tslib_1 from "tslib";
3 import { Immediate } from '../util/Immediate';
4 import { AsyncAction } from './AsyncAction';
5 var AsapAction = /*@__PURE__*/ (function (_super) {
6 tslib_1.__extends(AsapAction, _super);
7 function AsapAction(scheduler, work) {
8 var _this = _super.call(this, scheduler, work) || this;
9 _this.scheduler = scheduler;
13 AsapAction.prototype.requestAsyncId = function (scheduler, id, delay) {
14 if (delay === void 0) {
17 if (delay !== null && delay > 0) {
18 return _super.prototype.requestAsyncId.call(this, scheduler, id, delay);
20 scheduler.actions.push(this);
21 return scheduler.scheduled || (scheduler.scheduled = Immediate.setImmediate(scheduler.flush.bind(scheduler, null)));
23 AsapAction.prototype.recycleAsyncId = function (scheduler, id, delay) {
24 if (delay === void 0) {
27 if ((delay !== null && delay > 0) || (delay === null && this.delay > 0)) {
28 return _super.prototype.recycleAsyncId.call(this, scheduler, id, delay);
30 if (scheduler.actions.length === 0) {
31 Immediate.clearImmediate(id);
32 scheduler.scheduled = undefined;
38 export { AsapAction };
39 //# sourceMappingURL=AsapAction.js.map