import { Transformer } from "https://deno.land/x/rimbu@1.2.0/mod.ts";
const { flatMap } = Transformer;
Returns a transformer that applies the given flatMap function to each element of the input stream, and concatenates all the resulting resulting streams into one stream.
Parameters
flatMapFun: () => StreamSource<T2>
- a function that maps each input element to an
StreamSource
or a promise resolving to aStreamSource
. 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