# Code coverage report for RxJS/dist/cjs/observables/ErrorObservable.js

## Statements: 83.33% (30 / 36) Branches: 61.11% (11 / 18) Functions: 87.5% (7 / 8) Lines: 85.71% (24 / 28) Ignored: none

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

    1

    1

    39

    1

    1

    1

    1
    1

    1
    39

    39
    39
    39

    1
    35

    1

    1
    37
    37
    37

    37

    1

    1
    1'use strict';

    exports.__esModule = true;

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

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

    function _inherits(subClass, superClass) { Iif (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); Eif (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }

    var _Observable2 = require('../Observable');

    var _Observable3 = _interopRequireDefault(_Observable2);

    var ErrorObservable = (function (_Observable) {
        _inherits(ErrorObservable, _Observable);

        function ErrorObservable(error, scheduler) {
            _classCallCheck(this, ErrorObservable);

            _Observable.call(this);
            this.error = error;
            this.scheduler = scheduler;
        }

        ErrorObservable.create = function create(error, scheduler) {
            return new ErrorObservable(error, scheduler);
        };

        ErrorObservable.dispatch = function dispatch(_ref) {
            var error = _ref.error;
            var subscriber = _ref.subscriber;

            subscriber.error(error);
        };

        ErrorObservable.prototype._subscribe = function _subscribe(subscriber) {
            var error = this.error;
            var scheduler = this.scheduler;
            Iif (scheduler) {
                subscriber.add(scheduler.schedule(ErrorObservable.dispatch, 0, {
                    error: error, subscriber: subscriber
                }));
            } else {
                subscriber.error(error);
            }
        };

        return ErrorObservable;
    })(_Observable3['default']);

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