Code coverage report for cjs/scheduler/FutureAction.js

Statements: 90% (36 / 40)      Branches: 66.67% (10 / 15)      Functions: 100% (7 / 7)      Lines: 91.67% (33 / 36)      Ignored: none     

All files » cjs/scheduler/ » FutureAction.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 461 1 1 1   1 1 1 1 23 23 23   1 34 34 34     34 34 34 34       34 34 29 29 29   34   1 22 22 5 5   22   1   1  
var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) Eif (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var QueueAction_1 = require('./QueueAction');
var FutureAction = (function (_super) {
    __extends(FutureAction, _super);
    function FutureAction(scheduler, work) {
        _super.call(this, scheduler, work);
        this.scheduler = scheduler;
        this.work = work;
    }
    FutureAction.prototype.schedule = function (state, delay) {
        var _this = this;
        Iif (delay === void 0) { delay = 0; }
        Iif (this.isUnsubscribed) {
            return this;
        }
        this.delay = delay;
        this.state = state;
        var id = this.id;
        Iif (id != null) {
            this.id = undefined;
            clearTimeout(id);
        }
        var scheduler = this.scheduler;
        this.id = setTimeout(function () {
            _this.id = void 0;
            scheduler.actions.push(_this);
            scheduler.flush();
        }, this.delay);
        return this;
    };
    FutureAction.prototype.unsubscribe = function () {
        var id = this.id;
        if (id != null) {
            this.id = void 0;
            clearTimeout(id);
        }
        _super.prototype.unsubscribe.call(this);
    };
    return FutureAction;
})(QueueAction_1.QueueAction);
exports.FutureAction = FutureAction;
//# sourceMappingURL=FutureAction.js.map