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.
		
		
		
		
			
				
					39 lines
				
				1.6 KiB
			
		
		
			
		
	
	
					39 lines
				
				1.6 KiB
			| 
											5 years ago
										 | /** PURE_IMPORTS_START tslib,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */ | ||
|  | import * as tslib_1 from "tslib"; | ||
|  | import { OuterSubscriber } from '../OuterSubscriber'; | ||
|  | import { subscribeToResult } from '../util/subscribeToResult'; | ||
|  | export function takeUntil(notifier) { | ||
|  |     return function (source) { return source.lift(new TakeUntilOperator(notifier)); }; | ||
|  | } | ||
|  | var TakeUntilOperator = /*@__PURE__*/ (function () { | ||
|  |     function TakeUntilOperator(notifier) { | ||
|  |         this.notifier = notifier; | ||
|  |     } | ||
|  |     TakeUntilOperator.prototype.call = function (subscriber, source) { | ||
|  |         var takeUntilSubscriber = new TakeUntilSubscriber(subscriber); | ||
|  |         var notifierSubscription = subscribeToResult(takeUntilSubscriber, this.notifier); | ||
|  |         if (notifierSubscription && !takeUntilSubscriber.seenValue) { | ||
|  |             takeUntilSubscriber.add(notifierSubscription); | ||
|  |             return source.subscribe(takeUntilSubscriber); | ||
|  |         } | ||
|  |         return takeUntilSubscriber; | ||
|  |     }; | ||
|  |     return TakeUntilOperator; | ||
|  | }()); | ||
|  | var TakeUntilSubscriber = /*@__PURE__*/ (function (_super) { | ||
|  |     tslib_1.__extends(TakeUntilSubscriber, _super); | ||
|  |     function TakeUntilSubscriber(destination) { | ||
|  |         var _this = _super.call(this, destination) || this; | ||
|  |         _this.seenValue = false; | ||
|  |         return _this; | ||
|  |     } | ||
|  |     TakeUntilSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) { | ||
|  |         this.seenValue = true; | ||
|  |         this.complete(); | ||
|  |     }; | ||
|  |     TakeUntilSubscriber.prototype.notifyComplete = function () { | ||
|  |     }; | ||
|  |     return TakeUntilSubscriber; | ||
|  | }(OuterSubscriber)); | ||
|  | //# sourceMappingURL=takeUntil.js.map
 |