Actualizacion maquina principal
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / rxjs / _esm5 / internal / operators / shareReplay.js
diff --git a/.config/coc/extensions/node_modules/coc-prettier/node_modules/rxjs/_esm5/internal/operators/shareReplay.js b/.config/coc/extensions/node_modules/coc-prettier/node_modules/rxjs/_esm5/internal/operators/shareReplay.js
new file mode 100644 (file)
index 0000000..d71dd49
--- /dev/null
@@ -0,0 +1,59 @@
+/** PURE_IMPORTS_START _ReplaySubject PURE_IMPORTS_END */
+import { ReplaySubject } from '../ReplaySubject';
+export 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)); };
+}
+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(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();
+                },
+            });
+        }
+        else {
+            innerSub = subject.subscribe(this);
+        }
+        this.add(function () {
+            refCount--;
+            innerSub.unsubscribe();
+            if (subscription && !isComplete && useRefCount && refCount === 0) {
+                subscription.unsubscribe();
+                subscription = undefined;
+                subject = undefined;
+            }
+        });
+    };
+}
+//# sourceMappingURL=shareReplay.js.map