Actualizacion maquina principal
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / rxjs / _esm2015 / internal / operators / repeat.js
diff --git a/.config/coc/extensions/node_modules/coc-prettier/node_modules/rxjs/_esm2015/internal/operators/repeat.js b/.config/coc/extensions/node_modules/coc-prettier/node_modules/rxjs/_esm2015/internal/operators/repeat.js
new file mode 100644 (file)
index 0000000..8d4788f
--- /dev/null
@@ -0,0 +1,44 @@
+import { Subscriber } from '../Subscriber';
+import { empty } from '../observable/empty';
+export function repeat(count = -1) {
+    return (source) => {
+        if (count === 0) {
+            return empty();
+        }
+        else if (count < 0) {
+            return source.lift(new RepeatOperator(-1, source));
+        }
+        else {
+            return source.lift(new RepeatOperator(count - 1, source));
+        }
+    };
+}
+class RepeatOperator {
+    constructor(count, source) {
+        this.count = count;
+        this.source = source;
+    }
+    call(subscriber, source) {
+        return source.subscribe(new RepeatSubscriber(subscriber, this.count, this.source));
+    }
+}
+class RepeatSubscriber extends Subscriber {
+    constructor(destination, count, source) {
+        super(destination);
+        this.count = count;
+        this.source = source;
+    }
+    complete() {
+        if (!this.isStopped) {
+            const { source, count } = this;
+            if (count === 0) {
+                return super.complete();
+            }
+            else if (count > -1) {
+                this.count = count - 1;
+            }
+            source.subscribe(this._unsubscribeAndRecycle());
+        }
+    }
+}
+//# sourceMappingURL=repeat.js.map
\ No newline at end of file