aboutsummaryrefslogtreecommitdiff
path: root/sandbox/testAppNevena/Front/node_modules/rxjs/internal/operators/shareReplay.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/shareReplay.js
parent1fa69862057db4db53cfda5be9c24b4228ef63f7 (diff)
Urađena test aplikacija. Povezan front i back.
Diffstat (limited to 'sandbox/testAppNevena/Front/node_modules/rxjs/internal/operators/shareReplay.js')
-rw-r--r--sandbox/testAppNevena/Front/node_modules/rxjs/internal/operators/shareReplay.js67
1 files changed, 67 insertions, 0 deletions
diff --git a/sandbox/testAppNevena/Front/node_modules/rxjs/internal/operators/shareReplay.js b/sandbox/testAppNevena/Front/node_modules/rxjs/internal/operators/shareReplay.js
new file mode 100644
index 00000000..e4379ab3
--- /dev/null
+++ b/sandbox/testAppNevena/Front/node_modules/rxjs/internal/operators/shareReplay.js
@@ -0,0 +1,67 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var ReplaySubject_1 = require("../ReplaySubject");
+function shareReplay(configOrBufferSize, windowTime, scheduler) {
+ var config;
+ if (configOrBufferSize && typeof configOrBufferSize === 'object') {
+ config = configOrBufferSize;
+ }
+ else {
+ config = {
+ bufferSize: configOrBufferSize,
+ windowTime: windowTime,
+ refCount: false,
+ scheduler: scheduler,
+ };
+ }
+ return function (source) { return source.lift(shareReplayOperator(config)); };
+}
+exports.shareReplay = shareReplay;
+function shareReplayOperator(_a) {
+ var _b = _a.bufferSize, bufferSize = _b === void 0 ? Number.POSITIVE_INFINITY : _b, _c = _a.windowTime, windowTime = _c === void 0 ? Number.POSITIVE_INFINITY : _c, useRefCount = _a.refCount, scheduler = _a.scheduler;
+ var subject;
+ var refCount = 0;
+ var subscription;
+ var hasError = false;
+ var isComplete = false;
+ return function shareReplayOperation(source) {
+ refCount++;
+ var innerSub;
+ if (!subject || hasError) {
+ hasError = false;
+ subject = new ReplaySubject_1.ReplaySubject(bufferSize, windowTime, scheduler);
+ innerSub = subject.subscribe(this);
+ subscription = source.subscribe({
+ next: function (value) {
+ subject.next(value);
+ },
+ error: function (err) {
+ hasError = true;
+ subject.error(err);
+ },
+ complete: function () {
+ isComplete = true;
+ subscription = undefined;
+ subject.complete();
+ },
+ });
+ if (isComplete) {
+ subscription = undefined;
+ }
+ }
+ else {
+ innerSub = subject.subscribe(this);
+ }
+ this.add(function () {
+ refCount--;
+ innerSub.unsubscribe();
+ innerSub = undefined;
+ if (subscription && !isComplete && useRefCount && refCount === 0) {
+ subscription.unsubscribe();
+ subscription = undefined;
+ subject = undefined;
+ }
+ });
+ };
+}
+//# sourceMappingURL=shareReplay.js.map \ No newline at end of file