42a3c433291792969083d6308098b43fc634c70e76879a32d2f76fa58bd02ac0.json 1.1 KB

1
  1. {"ast":null,"code":"import { OuterSubscriber } from '../OuterSubscriber';\nimport { subscribeToResult } from '../util/subscribeToResult';\nexport function exhaust() {\n return source => source.lift(new SwitchFirstOperator());\n}\nclass SwitchFirstOperator {\n call(subscriber, source) {\n return source.subscribe(new SwitchFirstSubscriber(subscriber));\n }\n}\nclass SwitchFirstSubscriber extends OuterSubscriber {\n constructor(destination) {\n super(destination);\n this.hasCompleted = false;\n this.hasSubscription = false;\n }\n _next(value) {\n if (!this.hasSubscription) {\n this.hasSubscription = true;\n this.add(subscribeToResult(this, value));\n }\n }\n _complete() {\n this.hasCompleted = true;\n if (!this.hasSubscription) {\n this.destination.complete();\n }\n }\n notifyComplete(innerSub) {\n this.remove(innerSub);\n this.hasSubscription = false;\n if (this.hasCompleted) {\n this.destination.complete();\n }\n }\n}\n//# sourceMappingURL=exhaust.js.map","map":null,"metadata":{},"sourceType":"module","externalDependencies":[]}