Returns an operator that completes the source observable when the notifier observable either
completes or errors. Unlike takeUntil, which reacts only to the notifier’s next emissions,
this operator also stops the source when the notifier finishes or fails.
Returns
A MonoTypeOperatorFunction that completes the source when the notifier completes or errors.
Example
constnotifier$ = ajax.getJSON('/config'); // May error or complete
source$.pipe( takeUntilCompleteOrError(notifier$) ).subscribe({ next:console.log, complete: () =>console.log('Stopped due to notifier completing'), error:console.error });
// The subscription to source$ ends as soon as: // 1) notifier$ completes, or // 2) notifier$ errors.
// NOTE: Any values emitted by notifier$ are ignored.
Type Parameters
T
The value type of the source observable.
Parameters
notifier$: Observable<any>
Observable whose termination (complete or error) will stop the source.
Returns an operator that completes the source observable when the notifier observable either completes or errors. Unlike
takeUntil, which reacts only to the notifier’snextemissions, this operator also stops the source when the notifier finishes or fails.Returns
A
MonoTypeOperatorFunctionthat completes the source when the notifier completes or errors.Example