zipWith<S, R> method

Stream<R> zipWith <S, R>(
  1. Stream<S> other,
  2. R zipper(
    1. T t,
    2. S s
    )
)

Returns a Stream that combines the current stream together with another stream using a given zipper function.

Example

Stream.fromIterable([1])
    .zipWith(Stream.fromIterable([2]), (one, two) => one + two)
    .listen(print); // prints 3

Implementation

Stream<R> zipWith<S, R>(Stream<S> other, R Function(T t, S s) zipper) =>
    transform(StreamTransformer.fromBind(
        (stream) => ZipStream.zip2(stream, other, zipper)));