takeUntil<S> method

Stream<T> takeUntil <S>(
  1. Stream<S> otherStream
)

Returns the values from the source Stream sequence until the other Stream sequence produces a value.

Example

MergeStream([
    Stream.fromIterable([1]),
    TimerStream(2, Duration(minutes: 1))
  ])
  .takeUntil(TimerStream(3, Duration(seconds: 10)))
  .listen(print); // prints 1

Implementation

Stream<T> takeUntil<S>(Stream<S> otherStream) =>
    transform(TakeUntilStreamTransformer<T, S>(otherStream));