Code coverage report for cjs/operator/distinctUntilChanged.js

Statements: 100% (40 / 40)      Branches: 86.67% (13 / 15)      Functions: 100% (10 / 10)      Lines: 100% (37 / 37)      Ignored: none     

All files » cjs/operator/ » distinctUntilChanged.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 46 47 48 49 50 51 52 531 2 1 1   1 1 1 1 34   1 1 1 34   1 34   1   1 1 1 34 34 34 21     1 26   1 107 107 83 83 2 2       24   105 62 62     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 Subscriber_1 = require('../Subscriber');
var tryCatch_1 = require('../util/tryCatch');
var errorObject_1 = require('../util/errorObject');
function distinctUntilChanged(compare) {
    return this.lift(new DistinctUntilChangedOperator(compare));
}
exports.distinctUntilChanged = distinctUntilChanged;
var DistinctUntilChangedOperator = (function () {
    function DistinctUntilChangedOperator(compare) {
        this.compare = compare;
    }
    DistinctUntilChangedOperator.prototype.call = function (subscriber) {
        return new DistinctUntilChangedSubscriber(subscriber, this.compare);
    };
    return DistinctUntilChangedOperator;
})();
var DistinctUntilChangedSubscriber = (function (_super) {
    __extends(DistinctUntilChangedSubscriber, _super);
    function DistinctUntilChangedSubscriber(destination, compare) {
        _super.call(this, destination);
        this.hasValue = false;
        if (typeof compare === 'function') {
            this.compare = compare;
        }
    }
    DistinctUntilChangedSubscriber.prototype.compare = function (x, y) {
        return x === y;
    };
    DistinctUntilChangedSubscriber.prototype._next = function (value) {
        var result = false;
        if (this.hasValue) {
            result = tryCatch_1.tryCatch(this.compare)(this.value, value);
            if (result === errorObject_1.errorObject) {
                this.destination.error(errorObject_1.errorObject.e);
                return;
            }
        }
        else {
            this.hasValue = true;
        }
        if (Boolean(result) === false) {
            this.value = value;
            this.destination.next(value);
        }
    };
    return DistinctUntilChangedSubscriber;
})(Subscriber_1.Subscriber);
//# sourceMappingURL=distinctUntilChanged.js.map