aboutsummaryrefslogtreecommitdiff
path: root/sandbox/testAppNevena/Front/node_modules/rxjs/_esm5/internal/Subscription.js
diff options
context:
space:
mode:
authorNevena Bojovic <nenabojov@gmail.com>2022-03-01 20:05:50 +0100
committerNevena Bojovic <nenabojov@gmail.com>2022-03-01 20:05:50 +0100
commit291803c31f829fe0d32bb3207bc11def95a7408c (patch)
treec7d43107d79291b19d8c9eceefbe91c9f9a52acf /sandbox/testAppNevena/Front/node_modules/rxjs/_esm5/internal/Subscription.js
parent1fa69862057db4db53cfda5be9c24b4228ef63f7 (diff)
Urađena test aplikacija. Povezan front i back.
Diffstat (limited to 'sandbox/testAppNevena/Front/node_modules/rxjs/_esm5/internal/Subscription.js')
-rw-r--r--sandbox/testAppNevena/Front/node_modules/rxjs/_esm5/internal/Subscription.js140
1 files changed, 140 insertions, 0 deletions
diff --git a/sandbox/testAppNevena/Front/node_modules/rxjs/_esm5/internal/Subscription.js b/sandbox/testAppNevena/Front/node_modules/rxjs/_esm5/internal/Subscription.js
new file mode 100644
index 00000000..2527dd34
--- /dev/null
+++ b/sandbox/testAppNevena/Front/node_modules/rxjs/_esm5/internal/Subscription.js
@@ -0,0 +1,140 @@
+/** PURE_IMPORTS_START _util_isArray,_util_isObject,_util_isFunction,_util_UnsubscriptionError PURE_IMPORTS_END */
+import { isArray } from './util/isArray';
+import { isObject } from './util/isObject';
+import { isFunction } from './util/isFunction';
+import { UnsubscriptionError } from './util/UnsubscriptionError';
+var Subscription = /*@__PURE__*/ (function () {
+ function Subscription(unsubscribe) {
+ this.closed = false;
+ this._parentOrParents = null;
+ this._subscriptions = null;
+ if (unsubscribe) {
+ this._ctorUnsubscribe = true;
+ this._unsubscribe = unsubscribe;
+ }
+ }
+ Subscription.prototype.unsubscribe = function () {
+ var errors;
+ if (this.closed) {
+ return;
+ }
+ var _a = this, _parentOrParents = _a._parentOrParents, _ctorUnsubscribe = _a._ctorUnsubscribe, _unsubscribe = _a._unsubscribe, _subscriptions = _a._subscriptions;
+ this.closed = true;
+ this._parentOrParents = null;
+ this._subscriptions = null;
+ if (_parentOrParents instanceof Subscription) {
+ _parentOrParents.remove(this);
+ }
+ else if (_parentOrParents !== null) {
+ for (var index = 0; index < _parentOrParents.length; ++index) {
+ var parent_1 = _parentOrParents[index];
+ parent_1.remove(this);
+ }
+ }
+ if (isFunction(_unsubscribe)) {
+ if (_ctorUnsubscribe) {
+ this._unsubscribe = undefined;
+ }
+ try {
+ _unsubscribe.call(this);
+ }
+ catch (e) {
+ errors = e instanceof UnsubscriptionError ? flattenUnsubscriptionErrors(e.errors) : [e];
+ }
+ }
+ if (isArray(_subscriptions)) {
+ var index = -1;
+ var len = _subscriptions.length;
+ while (++index < len) {
+ var sub = _subscriptions[index];
+ if (isObject(sub)) {
+ try {
+ sub.unsubscribe();
+ }
+ catch (e) {
+ errors = errors || [];
+ if (e instanceof UnsubscriptionError) {
+ errors = errors.concat(flattenUnsubscriptionErrors(e.errors));
+ }
+ else {
+ errors.push(e);
+ }
+ }
+ }
+ }
+ }
+ if (errors) {
+ throw new UnsubscriptionError(errors);
+ }
+ };
+ Subscription.prototype.add = function (teardown) {
+ var subscription = teardown;
+ if (!teardown) {
+ return Subscription.EMPTY;
+ }
+ switch (typeof teardown) {
+ case 'function':
+ subscription = new Subscription(teardown);
+ case 'object':
+ if (subscription === this || subscription.closed || typeof subscription.unsubscribe !== 'function') {
+ return subscription;
+ }
+ else if (this.closed) {
+ subscription.unsubscribe();
+ return subscription;
+ }
+ else if (!(subscription instanceof Subscription)) {
+ var tmp = subscription;
+ subscription = new Subscription();
+ subscription._subscriptions = [tmp];
+ }
+ break;
+ default: {
+ throw new Error('unrecognized teardown ' + teardown + ' added to Subscription.');
+ }
+ }
+ var _parentOrParents = subscription._parentOrParents;
+ if (_parentOrParents === null) {
+ subscription._parentOrParents = this;
+ }
+ else if (_parentOrParents instanceof Subscription) {
+ if (_parentOrParents === this) {
+ return subscription;
+ }
+ subscription._parentOrParents = [_parentOrParents, this];
+ }
+ else if (_parentOrParents.indexOf(this) === -1) {
+ _parentOrParents.push(this);
+ }
+ else {
+ return subscription;
+ }
+ var subscriptions = this._subscriptions;
+ if (subscriptions === null) {
+ this._subscriptions = [subscription];
+ }
+ else {
+ subscriptions.push(subscription);
+ }
+ return subscription;
+ };
+ Subscription.prototype.remove = function (subscription) {
+ var subscriptions = this._subscriptions;
+ if (subscriptions) {
+ var subscriptionIndex = subscriptions.indexOf(subscription);
+ if (subscriptionIndex !== -1) {
+ subscriptions.splice(subscriptionIndex, 1);
+ }
+ }
+ };
+ Subscription.EMPTY = (function (empty) {
+ empty.closed = true;
+ return empty;
+ }(new Subscription()));
+ return Subscription;
+}());
+export { Subscription };
+function flattenUnsubscriptionErrors(errors) {
+ return errors.reduce(function (errs, err) { return errs.concat((err instanceof UnsubscriptionError) ? err.errors : err); }, []);
+}
+//# sourceMappingURL=Subscription.js.map