method StreamClass.zipWith
Private
StreamClass.zipWith<U extends readonly unknown[], R>(
sources: [K in keyof U]: Source<U[K]>,
fn: (...values: [K in keyof U]: Exclude<U[K], AnyFailure>) => R
): StreamClass<Exclude<R, AnyFailure>, Extract<U[number] | R, AnyFailure>>

zip plus a combiner — Elixir's Stream.zip_with; the tuple arrives spread.

await Stream.zipWith([[1, 2], [10, 20]], (a, b) => a + b).collect(); // [11, 22]

Type Parameters

U extends readonly unknown[]

Parameters

sources: [K in keyof U]: Source<U[K]>
fn: (...values: [K in keyof U]: Exclude<U[K], AnyFailure>) => R

Return Type

StreamClass<Exclude<R, AnyFailure>, Extract<U[number] | R, AnyFailure>>

Usage

import { StreamClass } from "lib/stream/stream.ts";