You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

1 lines
957 B

{"ast":null,"code":"import { Subscriber } from '../Subscriber';\nexport function defaultIfEmpty(defaultValue = null) {\n return source => source.lift(new DefaultIfEmptyOperator(defaultValue));\n}\n\nclass DefaultIfEmptyOperator {\n constructor(defaultValue) {\n this.defaultValue = defaultValue;\n }\n\n call(subscriber, source) {\n return source.subscribe(new DefaultIfEmptySubscriber(subscriber, this.defaultValue));\n }\n\n}\n\nclass DefaultIfEmptySubscriber extends Subscriber {\n constructor(destination, defaultValue) {\n super(destination);\n this.defaultValue = defaultValue;\n this.isEmpty = true;\n }\n\n _next(value) {\n this.isEmpty = false;\n this.destination.next(value);\n }\n\n _complete() {\n if (this.isEmpty) {\n this.destination.next(this.defaultValue);\n }\n\n this.destination.complete();\n }\n\n} //# sourceMappingURL=defaultIfEmpty.js.map","map":null,"metadata":{},"sourceType":"module"}