/** PURE_IMPORTS_START _util_canReportError,_util_toSubscriber,_symbol_observable,_util_pipe,_config PURE_IMPORTS_END */ import { canReportError } from './util/canReportError'; import { toSubscriber } from './util/toSubscriber'; import { observable as Symbol_observable } from './symbol/observable'; import { pipeFromArray } from './util/pipe'; import { config } from './config'; var Observable = /*@__PURE__*/ (function () { function Observable(subscribe) { this._isScalar = false; if (subscribe) { this._subscribe = subscribe; } } Observable.prototype.lift = function (operator) { var observable = new Observable(); observable.source = this; observable.operator = operator; return observable; }; Observable.prototype.subscribe = function (observerOrNext, error, complete) { var operator = this.operator; var sink = toSubscriber(observerOrNext, error, complete); if (operator) { sink.add(operator.call(sink, this.source)); } else { sink.add(this.source || (config.useDeprecatedSynchronousErrorHandling && !sink.syncErrorThrowable) ? this._subscribe(sink) : this._trySubscribe(sink)); } if (config.useDeprecatedSynchronousErrorHandling) { if (sink.syncErrorThrowable) { sink.syncErrorThrowable = false; if (sink.syncErrorThrown) { throw sink.syncErrorValue; } } } return sink; }; Observable.prototype._trySubscribe = function (sink) { try { return this._subscribe(sink); } catch (err) { if (config.useDeprecatedSynchronousErrorHandling) { sink.syncErrorThrown = true; sink.syncErrorValue = err; } if (canReportError(sink)) { sink.error(err); } else { console.warn(err); } } }; Observable.prototype.forEach = function (next, promiseCtor) { var _this = this; promiseCtor = getPromiseCtor(promiseCtor); return new promiseCtor(function (resolve, reject) { var subscription; subscription = _this.subscribe(function (value) { try { next(value); } catch (err) { reject(err); if (subscription) { subscription.unsubscribe(); } } }, reject, resolve); }); }; Observable.prototype._subscribe = function (subscriber) { var source = this.source; return source && source.subscribe(subscriber); }; Observable.prototype[Symbol_observable] = function () { return this; }; Observable.prototype.pipe = function () { var operations = []; for (var _i = 0; _i < arguments.length; _i++) { operations[_i] = arguments[_i]; } if (operations.length === 0) { return this; } return pipeFromArray(operations)(this); }; Observable.prototype.toPromise = function (promiseCtor) { var _this = this; promiseCtor = getPromiseCtor(promiseCtor); return new promiseCtor(function (resolve, reject) { var value; _this.subscribe(function (x) { return value = x; }, function (err) { return reject(err); }, function () { return resolve(value); }); }); }; Observable.create = function (subscribe) { return new Observable(subscribe); }; return Observable; }()); export { Observable }; function getPromiseCtor(promiseCtor) { if (!promiseCtor) { promiseCtor = config.Promise || Promise; } if (!promiseCtor) { throw new Error('no Promise impl found'); } return promiseCtor; } //# sourceMappingURL=Observable.js.map
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
observable | Folder | 0755 |
|
|
operators | Folder | 0755 |
|
|
scheduled | Folder | 0755 |
|
|
scheduler | Folder | 0755 |
|
|
symbol | Folder | 0755 |
|
|
testing | Folder | 0755 |
|
|
util | Folder | 0755 |
|
|
AsyncSubject.js | File | 1.59 KB | 0644 |
|
AsyncSubject.js.map | File | 1.14 KB | 0644 |
|
BehaviorSubject.js | File | 1.46 KB | 0644 |
|
BehaviorSubject.js.map | File | 930 B | 0644 |
|
InnerSubscriber.js | File | 1.04 KB | 0644 |
|
InnerSubscriber.js.map | File | 805 B | 0644 |
|
Notification.js | File | 2.7 KB | 0644 |
|
Notification.js.map | File | 2.17 KB | 0644 |
|
Observable.js | File | 3.95 KB | 0644 |
|
Observable.js.map | File | 3.13 KB | 0644 |
|
Observer.js | File | 494 B | 0644 |
|
Observer.js.map | File | 448 B | 0644 |
|
Operator.js | File | 37 B | 0644 |
|
Operator.js.map | File | 105 B | 0644 |
|
OuterSubscriber.js | File | 866 B | 0644 |
|
OuterSubscriber.js.map | File | 548 B | 0644 |
|
ReplaySubject.js | File | 4.36 KB | 0644 |
|
ReplaySubject.js.map | File | 3.55 KB | 0644 |
|
Rx.js | File | 7.66 KB | 0644 |
|
Rx.js.map | File | 4.49 KB | 0644 |
|
Scheduler.js | File | 602 B | 0644 |
|
Scheduler.js.map | File | 537 B | 0644 |
|
Subject.js | File | 5.25 KB | 0644 |
|
Subject.js.map | File | 3.97 KB | 0644 |
|
SubjectSubscription.js | File | 1.14 KB | 0644 |
|
SubjectSubscription.js.map | File | 868 B | 0644 |
|
Subscriber.js | File | 8.44 KB | 0644 |
|
Subscriber.js.map | File | 6.01 KB | 0644 |
|
Subscription.js | File | 5.09 KB | 0644 |
|
Subscription.js.map | File | 3.87 KB | 0644 |
|
config.js | File | 859 B | 0644 |
|
config.js.map | File | 513 B | 0644 |
|
innerSubscribe.js | File | 3.5 KB | 0644 |
|
innerSubscribe.js.map | File | 2.16 KB | 0644 |
|
types.js | File | 34 B | 0644 |
|
types.js.map | File | 99 B | 0644 |
|