Skip to content

@epikodelabs/streamix


@epikodelabs/streamix / takeUntil

Function: takeUntil()

takeUntil<T, N>(notifier): Operator<T, T>

Defined in: projects/libraries/streamix/src/lib/operators/takeUntil.ts:27

Take values from the source until a notifier emits.

This operator forwards values from the source stream until the notifier emits its first value or completes. 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 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

A Stream<N> or Promise<N> that signals when to stop taking.

Stream<N> | Promise<N>

Returns

Operator<T, T>

An Operator<T, T> that can be used in a stream pipeline.

Released under the MIT License.