@epikodelabs/streamix / src/public-api / takeUntil
Function: takeUntil()
takeUntil<
T,N>(notifier):Operator<T,T>
Defined in: projects/libraries/streamix/src/lib/operators/takeUntil.ts:25
Take values from the source until a notifier emits.
This operator forwards values from the source stream until the notifier emits its first value. Once the notifier emits, the operator completes immediately and unsubscribes from the source.
Important semantics:
- If notifier emits before any source values, no source values are emitted
- If the notifier completes without ever emitting, the operator keeps mirroring the source (only an emission triggers the stop)
- If source completes before notifier emits, operator completes normally
- Errors from either source or notifier are propagated
Type Parameters
T
T = any
Source/output value type.
N
N = any
Notifier value type (ignored by this operator).
Parameters
notifier
PipeInput<N>
A AtomBase<N> or Promise<N> that signals when to stop taking.
Returns
Operator<T, T>
An Operator<T, T> that can be used in a stream pipeline.