72ea18e5837de2180946a4333be1731fce59e490
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / rxjs / _esm5 / internal / operators / takeUntil.js
1 /** PURE_IMPORTS_START tslib,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
2 import * as tslib_1 from "tslib";
3 import { OuterSubscriber } from '../OuterSubscriber';
4 import { subscribeToResult } from '../util/subscribeToResult';
5 export function takeUntil(notifier) {
6     return function (source) { return source.lift(new TakeUntilOperator(notifier)); };
7 }
8 var TakeUntilOperator = /*@__PURE__*/ (function () {
9     function TakeUntilOperator(notifier) {
10         this.notifier = notifier;
11     }
12     TakeUntilOperator.prototype.call = function (subscriber, source) {
13         var takeUntilSubscriber = new TakeUntilSubscriber(subscriber);
14         var notifierSubscription = subscribeToResult(takeUntilSubscriber, this.notifier);
15         if (notifierSubscription && !takeUntilSubscriber.seenValue) {
16             takeUntilSubscriber.add(notifierSubscription);
17             return source.subscribe(takeUntilSubscriber);
18         }
19         return takeUntilSubscriber;
20     };
21     return TakeUntilOperator;
22 }());
23 var TakeUntilSubscriber = /*@__PURE__*/ (function (_super) {
24     tslib_1.__extends(TakeUntilSubscriber, _super);
25     function TakeUntilSubscriber(destination) {
26         var _this = _super.call(this, destination) || this;
27         _this.seenValue = false;
28         return _this;
29     }
30     TakeUntilSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
31         this.seenValue = true;
32         this.complete();
33     };
34     TakeUntilSubscriber.prototype.notifyComplete = function () {
35     };
36     return TakeUntilSubscriber;
37 }(OuterSubscriber));
38 //# sourceMappingURL=takeUntil.js.map