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

x/rimbu/core/mod.ts>AsyncTransformer.collect

Rimbu is a TypeScript library focused on immutable, performant, and type-safe collections and other tools.
Go to Latest
function AsyncTransformer.collect
import { AsyncTransformer } from "https://deno.land/x/rimbu@1.2.0/core/mod.ts";
const { collect } = AsyncTransformer;

Returns an AsyncTransformer instance that converts or filters its input values using given collectFun before passing them to the reducer.

Parameters

collectFun: AsyncCollectFun<T, R>
  • a potentially async function receiving the following arguments, and returns a new value or skip if the value should be skipped:
  • value: the next value
  • index: the value index
  • skip: a token that, when returned, will not add a value to the resulting collection
  • halt: a function that, when called, ensures no next elements are passed