Code coverage report for cjs/operator/groupBy-support.js

Statements: 100% (55 / 55)      Branches: 88% (22 / 25)      Functions: 100% (12 / 12)      Lines: 100% (52 / 52)      Ignored: none     

All files » cjs/operator/ » groupBy-support.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 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 691 22 3 3   1 1 1 1 1 37 37 37   1 37   1 39 36 36 33 33       1   1 1 1 1 171 171 171 171   1 150 150 84   150 150   1   1 1 1 1 84 84 84   1 84 84 84 84 3 3       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 Subscription_1 = require('../Subscription');
var Observable_1 = require('../Observable');
var RefCountSubscription = (function (_super) {
    __extends(RefCountSubscription, _super);
    function RefCountSubscription() {
        _super.call(this);
        this.attemptedToUnsubscribePrimary = false;
        this.count = 0;
    }
    RefCountSubscription.prototype.setPrimary = function (subscription) {
        this.primary = subscription;
    };
    RefCountSubscription.prototype.unsubscribe = function () {
        if (!this.isUnsubscribed && !this.attemptedToUnsubscribePrimary) {
            this.attemptedToUnsubscribePrimary = true;
            if (this.count === 0) {
                _super.prototype.unsubscribe.call(this);
                this.primary.unsubscribe();
            }
        }
    };
    return RefCountSubscription;
})(Subscription_1.Subscription);
exports.RefCountSubscription = RefCountSubscription;
var GroupedObservable = (function (_super) {
    __extends(GroupedObservable, _super);
    function GroupedObservable(key, groupSubject, refCountSubscription) {
        _super.call(this);
        this.key = key;
        this.groupSubject = groupSubject;
        this.refCountSubscription = refCountSubscription;
    }
    GroupedObservable.prototype._subscribe = function (subscriber) {
        var subscription = new Subscription_1.Subscription();
        if (this.refCountSubscription && !this.refCountSubscription.isUnsubscribed) {
            subscription.add(new InnerRefCountSubscription(this.refCountSubscription));
        }
        subscription.add(this.groupSubject.subscribe(subscriber));
        return subscription;
    };
    return GroupedObservable;
})(Observable_1.Observable);
exports.GroupedObservable = GroupedObservable;
var InnerRefCountSubscription = (function (_super) {
    __extends(InnerRefCountSubscription, _super);
    function InnerRefCountSubscription(parent) {
        _super.call(this);
        this.parent = parent;
        parent.count++;
    }
    InnerRefCountSubscription.prototype.unsubscribe = function () {
        Eif (!this.parent.isUnsubscribed && !this.isUnsubscribed) {
            _super.prototype.unsubscribe.call(this);
            this.parent.count--;
            if (this.parent.count === 0 && this.parent.attemptedToUnsubscribePrimary) {
                this.parent.unsubscribe();
                this.parent.primary.unsubscribe();
            }
        }
    };
    return InnerRefCountSubscription;
})(Subscription_1.Subscription);
exports.InnerRefCountSubscription = InnerRefCountSubscription;
//# sourceMappingURL=groupBy-support.js.map