Actualizacion maquina principal
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / rxjs / _esm5 / internal / operators / defaultIfEmpty.js
diff --git a/.config/coc/extensions/node_modules/coc-prettier/node_modules/rxjs/_esm5/internal/operators/defaultIfEmpty.js b/.config/coc/extensions/node_modules/coc-prettier/node_modules/rxjs/_esm5/internal/operators/defaultIfEmpty.js
new file mode 100644 (file)
index 0000000..3fa86ca
--- /dev/null
@@ -0,0 +1,39 @@
+/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */
+import * as tslib_1 from "tslib";
+import { Subscriber } from '../Subscriber';
+export function defaultIfEmpty(defaultValue) {
+    if (defaultValue === void 0) {
+        defaultValue = null;
+    }
+    return function (source) { return source.lift(new DefaultIfEmptyOperator(defaultValue)); };
+}
+var DefaultIfEmptyOperator = /*@__PURE__*/ (function () {
+    function DefaultIfEmptyOperator(defaultValue) {
+        this.defaultValue = defaultValue;
+    }
+    DefaultIfEmptyOperator.prototype.call = function (subscriber, source) {
+        return source.subscribe(new DefaultIfEmptySubscriber(subscriber, this.defaultValue));
+    };
+    return DefaultIfEmptyOperator;
+}());
+var DefaultIfEmptySubscriber = /*@__PURE__*/ (function (_super) {
+    tslib_1.__extends(DefaultIfEmptySubscriber, _super);
+    function DefaultIfEmptySubscriber(destination, defaultValue) {
+        var _this = _super.call(this, destination) || this;
+        _this.defaultValue = defaultValue;
+        _this.isEmpty = true;
+        return _this;
+    }
+    DefaultIfEmptySubscriber.prototype._next = function (value) {
+        this.isEmpty = false;
+        this.destination.next(value);
+    };
+    DefaultIfEmptySubscriber.prototype._complete = function () {
+        if (this.isEmpty) {
+            this.destination.next(this.defaultValue);
+        }
+        this.destination.complete();
+    };
+    return DefaultIfEmptySubscriber;
+}(Subscriber));
+//# sourceMappingURL=defaultIfEmpty.js.map