zip7<A, B, C, D, E, F, G, T> static method

Stream<T> zip7<A, B, C, D, E, F, G, T>(
  1. Stream<A> streamA,
  2. Stream<B> streamB,
  3. Stream<C> streamC,
  4. Stream<D> streamD,
  5. Stream<E> streamE,
  6. Stream<F> streamF,
  7. Stream<G> streamG,
  8. T zipper(
    1. A a,
    2. B b,
    3. C c,
    4. D d,
    5. E e,
    6. F f,
    7. G g
    )
)

Merges the specified streams into one stream sequence using the given zipper function whenever all of the stream sequences have produced an element at a corresponding index.

It applies this function in strict sequence, so the first item emitted by the new Stream will be the result of the function applied to the first item emitted by Stream #1 and the first item emitted by Stream #2; the second item emitted by the new ZipStream will be the result of the function applied to the second item emitted by Stream #1 and the second item emitted by Stream #2; and so forth. It will only emit as many items as the number of items emitted by the source Stream that emits the fewest items.

Interactive marble diagram

Example

Rx.zip7(
  Stream.value('a'),
  Stream.value('b'),
  Stream.value('c'),
  Stream.value('d'),
  Stream.value('e'),
  Stream.value('f'),
  Stream.fromIterable(['g', 'dropped']),
  (a, b, c, d, e, f, g) => a + b + c + d + e + f + g)
.listen(print); //prints 'abcdefg'

Implementation

static Stream<T> zip7<A, B, C, D, E, F, G, T>(
        Stream<A> streamA,
        Stream<B> streamB,
        Stream<C> streamC,
        Stream<D> streamD,
        Stream<E> streamE,
        Stream<F> streamF,
        Stream<G> streamG,
        T Function(A a, B b, C c, D d, E e, F f, G g) zipper) =>
    ZipStream.zip7(
      streamA,
      streamB,
      streamC,
      streamD,
      streamE,
      streamF,
      streamG,
      zipper,
    );