zip4<A, B, C, D, R> method

ZipStream<dynamic, R> zip4 <A, B, C, D, R>(
  1. Stream<A> streamA,
  2. Stream<B> streamB,
  3. Stream<C> streamC,
  4. Stream<D> streamD,
  5. R zipper(
    1. A a,
    2. B b,
    3. C c,
    4. D d
    )
)

Constructs a Stream which merges the specified Streams into a sequence using the given zipper Function, whenever all of the provided Streams have produced an element at a corresponding index.

Implementation

static ZipStream<dynamic, R> zip4<A, B, C, D, R>(
  Stream<A> streamA,
  Stream<B> streamB,
  Stream<C> streamC,
  Stream<D> streamD,
  R Function(A a, B b, C c, D d) zipper,
) {
  return ZipStream<dynamic, R>(
    [streamA, streamB, streamC, streamD],
    (List<dynamic> values) {
      return zipper(
        values[0] as A,
        values[1] as B,
        values[2] as C,
        values[3] as D,
      );
    },
  );
}