aboutsummaryrefslogtreecommitdiff
path: root/sandbox/testAppNevena/Front/node_modules/rxjs/internal/operators/windowWhen.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/internal/operators/windowWhen.js
parent1fa69862057db4db53cfda5be9c24b4228ef63f7 (diff)
Urađena test aplikacija. Povezan front i back.
Diffstat (limited to 'sandbox/testAppNevena/Front/node_modules/rxjs/internal/operators/windowWhen.js')
-rw-r--r--sandbox/testAppNevena/Front/node_modules/rxjs/internal/operators/windowWhen.js96
1 files changed, 96 insertions, 0 deletions
diff --git a/sandbox/testAppNevena/Front/node_modules/rxjs/internal/operators/windowWhen.js b/sandbox/testAppNevena/Front/node_modules/rxjs/internal/operators/windowWhen.js
new file mode 100644
index 00000000..c38bfa2d
--- /dev/null
+++ b/sandbox/testAppNevena/Front/node_modules/rxjs/internal/operators/windowWhen.js
@@ -0,0 +1,96 @@
+"use strict";
+var __extends = (this && this.__extends) || (function () {
+ var extendStatics = function (d, b) {
+ extendStatics = Object.setPrototypeOf ||
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+ return extendStatics(d, b);
+ }
+ return function (d, b) {
+ extendStatics(d, b);
+ function __() { this.constructor = d; }
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+ };
+})();
+Object.defineProperty(exports, "__esModule", { value: true });
+var Subject_1 = require("../Subject");
+var OuterSubscriber_1 = require("../OuterSubscriber");
+var subscribeToResult_1 = require("../util/subscribeToResult");
+function windowWhen(closingSelector) {
+ return function windowWhenOperatorFunction(source) {
+ return source.lift(new WindowOperator(closingSelector));
+ };
+}
+exports.windowWhen = windowWhen;
+var WindowOperator = (function () {
+ function WindowOperator(closingSelector) {
+ this.closingSelector = closingSelector;
+ }
+ WindowOperator.prototype.call = function (subscriber, source) {
+ return source.subscribe(new WindowSubscriber(subscriber, this.closingSelector));
+ };
+ return WindowOperator;
+}());
+var WindowSubscriber = (function (_super) {
+ __extends(WindowSubscriber, _super);
+ function WindowSubscriber(destination, closingSelector) {
+ var _this = _super.call(this, destination) || this;
+ _this.destination = destination;
+ _this.closingSelector = closingSelector;
+ _this.openWindow();
+ return _this;
+ }
+ WindowSubscriber.prototype.notifyNext = function (_outerValue, _innerValue, _outerIndex, _innerIndex, innerSub) {
+ this.openWindow(innerSub);
+ };
+ WindowSubscriber.prototype.notifyError = function (error) {
+ this._error(error);
+ };
+ WindowSubscriber.prototype.notifyComplete = function (innerSub) {
+ this.openWindow(innerSub);
+ };
+ WindowSubscriber.prototype._next = function (value) {
+ this.window.next(value);
+ };
+ WindowSubscriber.prototype._error = function (err) {
+ this.window.error(err);
+ this.destination.error(err);
+ this.unsubscribeClosingNotification();
+ };
+ WindowSubscriber.prototype._complete = function () {
+ this.window.complete();
+ this.destination.complete();
+ this.unsubscribeClosingNotification();
+ };
+ WindowSubscriber.prototype.unsubscribeClosingNotification = function () {
+ if (this.closingNotification) {
+ this.closingNotification.unsubscribe();
+ }
+ };
+ WindowSubscriber.prototype.openWindow = function (innerSub) {
+ if (innerSub === void 0) { innerSub = null; }
+ if (innerSub) {
+ this.remove(innerSub);
+ innerSub.unsubscribe();
+ }
+ var prevWindow = this.window;
+ if (prevWindow) {
+ prevWindow.complete();
+ }
+ var window = this.window = new Subject_1.Subject();
+ this.destination.next(window);
+ var closingNotifier;
+ try {
+ var closingSelector = this.closingSelector;
+ closingNotifier = closingSelector();
+ }
+ catch (e) {
+ this.destination.error(e);
+ this.window.error(e);
+ return;
+ }
+ this.add(this.closingNotification = subscribeToResult_1.subscribeToResult(this, closingNotifier));
+ };
+ return WindowSubscriber;
+}(OuterSubscriber_1.OuterSubscriber));
+//# sourceMappingURL=windowWhen.js.map \ No newline at end of file