2 var __extends = (this && this.__extends) || (function () {
3 var extendStatics = function (d, b) {
4 extendStatics = Object.setPrototypeOf ||
5 ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6 function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7 return extendStatics(d, b);
9 return function (d, b) {
11 function __() { this.constructor = d; }
12 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15 Object.defineProperty(exports, "__esModule", { value: true });
16 var AsyncAction_1 = require("./AsyncAction");
17 var QueueAction = (function (_super) {
18 __extends(QueueAction, _super);
19 function QueueAction(scheduler, work) {
20 var _this = _super.call(this, scheduler, work) || this;
21 _this.scheduler = scheduler;
25 QueueAction.prototype.schedule = function (state, delay) {
26 if (delay === void 0) { delay = 0; }
28 return _super.prototype.schedule.call(this, state, delay);
32 this.scheduler.flush(this);
35 QueueAction.prototype.execute = function (state, delay) {
36 return (delay > 0 || this.closed) ?
37 _super.prototype.execute.call(this, state, delay) :
38 this._execute(state, delay);
40 QueueAction.prototype.requestAsyncId = function (scheduler, id, delay) {
41 if (delay === void 0) { delay = 0; }
42 if ((delay !== null && delay > 0) || (delay === null && this.delay > 0)) {
43 return _super.prototype.requestAsyncId.call(this, scheduler, id, delay);
45 return scheduler.flush(this);
48 }(AsyncAction_1.AsyncAction));
49 exports.QueueAction = QueueAction;
50 //# sourceMappingURL=QueueAction.js.map