Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/rimbu/core/mod.ts>Transformer.flatZip

Rimbu is a TypeScript library focused on immutable, performant, and type-safe collections and other tools.
Go to Latest
function Transformer.flatZip
import { Transformer } from "https://deno.land/x/rimbu@1.2.0/core/mod.ts";
const { flatZip } = 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, where each resulting element is tupled with the originating input element.

Parameters

flatMapFun: (
value: T,
index: number,
halt: () => void,
) => StreamSource<T2>
  • a function that maps each input element to an StreamSource or a promise resolving to an StreamSource. The function receives three parameters:
  • value: the current element being processed
  • index: the index of the current element in the input stream
  • halt: a function that can be called to halt further processing of the input stream