1 /** PURE_IMPORTS_START tslib,_innerSubscribe PURE_IMPORTS_END */
2 import * as tslib_1 from "tslib";
3 import { innerSubscribe, SimpleInnerSubscriber, SimpleOuterSubscriber } from '../innerSubscribe';
4 export function takeUntil(notifier) {
5 return function (source) { return source.lift(new TakeUntilOperator(notifier)); };
7 var TakeUntilOperator = /*@__PURE__*/ (function () {
8 function TakeUntilOperator(notifier) {
9 this.notifier = notifier;
11 TakeUntilOperator.prototype.call = function (subscriber, source) {
12 var takeUntilSubscriber = new TakeUntilSubscriber(subscriber);
13 var notifierSubscription = innerSubscribe(this.notifier, new SimpleInnerSubscriber(takeUntilSubscriber));
14 if (notifierSubscription && !takeUntilSubscriber.seenValue) {
15 takeUntilSubscriber.add(notifierSubscription);
16 return source.subscribe(takeUntilSubscriber);
18 return takeUntilSubscriber;
20 return TakeUntilOperator;
22 var TakeUntilSubscriber = /*@__PURE__*/ (function (_super) {
23 tslib_1.__extends(TakeUntilSubscriber, _super);
24 function TakeUntilSubscriber(destination) {
25 var _this = _super.call(this, destination) || this;
26 _this.seenValue = false;
29 TakeUntilSubscriber.prototype.notifyNext = function () {
30 this.seenValue = true;
33 TakeUntilSubscriber.prototype.notifyComplete = function () {
35 return TakeUntilSubscriber;
36 }(SimpleOuterSubscriber));
37 //# sourceMappingURL=takeUntil.js.map