1 | "use strict";
|
---|
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);
|
---|
8 | }
|
---|
9 | return function (d, b) {
|
---|
10 | extendStatics(d, b);
|
---|
11 | function __() { this.constructor = d; }
|
---|
12 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
---|
13 | };
|
---|
14 | })();
|
---|
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;
|
---|
22 | _this.work = work;
|
---|
23 | return _this;
|
---|
24 | }
|
---|
25 | QueueAction.prototype.schedule = function (state, delay) {
|
---|
26 | if (delay === void 0) { delay = 0; }
|
---|
27 | if (delay > 0) {
|
---|
28 | return _super.prototype.schedule.call(this, state, delay);
|
---|
29 | }
|
---|
30 | this.delay = delay;
|
---|
31 | this.state = state;
|
---|
32 | this.scheduler.flush(this);
|
---|
33 | return this;
|
---|
34 | };
|
---|
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);
|
---|
39 | };
|
---|
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);
|
---|
44 | }
|
---|
45 | return scheduler.flush(this);
|
---|
46 | };
|
---|
47 | return QueueAction;
|
---|
48 | }(AsyncAction_1.AsyncAction));
|
---|
49 | exports.QueueAction = QueueAction;
|
---|
50 | //# sourceMappingURL=QueueAction.js.map |
---|