import { AsyncTransformer } from "https://deno.land/x/rimbu@1.2.1/stream/async/async-transformer.ts";
const { flatZip } = AsyncTransformer;
Returns an async transformer that applies the given flatMap function to each element of the input stream, and concatenates all the resulting resulting streams into one stream, where each resulting element is tupled with the originating input element.
Parameters
flatMapFun: () => MaybePromise<AsyncStreamSource<T2>>
- a potentially async function that maps each input element to an
AsyncStreamSource
. The function receives three parameters: value
: the current element being processedindex
: the index of the current element in the input streamhalt
: a function that can be called to halt further processing of the input stream
Returns
AsyncTransformer<T, [T, T2]>