# Code coverage report for RxJS/dist/cjs/testing/SubscriptionLoggable.js

## Statements: 81.82% (18 / 22) Branches: 50% (3 / 6) Functions: 66.67% (4 / 6) Lines: 89.47% (17 / 19) Ignored: none

All files » RxJS/dist/cjs/testing/ » SubscriptionLoggable.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

    1

    1

    1

    1

    1

    1
    1

    1
    854
    854

    1
    779
    779
    779

    1

    1
    1'use strict';

    exports.__esModule = true;

    function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }

    function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }

    var _SubscriptionLog = require('./SubscriptionLog');

    var _SubscriptionLog2 = _interopRequireDefault(_SubscriptionLog);

    var SubscriptionLoggable = (function () {
        function SubscriptionLoggable() {
            _classCallCheck(this, SubscriptionLoggable);

            this.subscriptions = [];
        }

        SubscriptionLoggable.prototype.logSubscribedFrame = function logSubscribedFrame() {
            this.subscriptions.push(new _SubscriptionLog2['default'](this.scheduler.now()));
            return this.subscriptions.length - 1;
        };

        SubscriptionLoggable.prototype.logUnsubscribedFrame = function logUnsubscribedFrame(index) {
            var subscriptionLogs = this.subscriptions;
            var oldSubscriptionLog = subscriptionLogs[index];
            subscriptionLogs[index] = new _SubscriptionLog2['default'](oldSubscriptionLog.subscribedFrame, this.scheduler.now());
        };

        return SubscriptionLoggable;
    })();

    exports['default'] = SubscriptionLoggable;
    module.exports = exports['default'];