aboutsummaryrefslogtreecommitdiff
path: root/sandbox/testAppNevena/Front/node_modules/rxjs/internal/Observable.js
diff options
context:
space:
mode:
Diffstat (limited to 'sandbox/testAppNevena/Front/node_modules/rxjs/internal/Observable.js')
-rw-r--r--sandbox/testAppNevena/Front/node_modules/rxjs/internal/Observable.js117
1 files changed, 0 insertions, 117 deletions
diff --git a/sandbox/testAppNevena/Front/node_modules/rxjs/internal/Observable.js b/sandbox/testAppNevena/Front/node_modules/rxjs/internal/Observable.js
deleted file mode 100644
index 780998b8..00000000
--- a/sandbox/testAppNevena/Front/node_modules/rxjs/internal/Observable.js
+++ /dev/null
@@ -1,117 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-var canReportError_1 = require("./util/canReportError");
-var toSubscriber_1 = require("./util/toSubscriber");
-var observable_1 = require("./symbol/observable");
-var pipe_1 = require("./util/pipe");
-var config_1 = require("./config");
-var Observable = (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_1.toSubscriber(observerOrNext, error, complete);
- if (operator) {
- sink.add(operator.call(sink, this.source));
- }
- else {
- sink.add(this.source || (config_1.config.useDeprecatedSynchronousErrorHandling && !sink.syncErrorThrowable) ?
- this._subscribe(sink) :
- this._trySubscribe(sink));
- }
- if (config_1.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_1.config.useDeprecatedSynchronousErrorHandling) {
- sink.syncErrorThrown = true;
- sink.syncErrorValue = err;
- }
- if (canReportError_1.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[observable_1.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 pipe_1.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;
-}());
-exports.Observable = Observable;
-function getPromiseCtor(promiseCtor) {
- if (!promiseCtor) {
- promiseCtor = config_1.config.Promise || Promise;
- }
- if (!promiseCtor) {
- throw new Error('no Promise impl found');
- }
- return promiseCtor;
-}
-//# sourceMappingURL=Observable.js.map \ No newline at end of file