import { Transformer } from "https://deno.land/x/rimbu@1.2.0/core/mod.ts";
const { collect } = Transformer;
Returns a Transformer
instance that converts or filters its input values using given collectFun
before passing them to the reducer.
Parameters
collectFun: CollectFun<T, R>
- a function receiving the following arguments, and returns a new value or
skip
if the value should be skipped: value
: the next valueindex
: the value indexskip
: a token that, when returned, will not add a value to the resulting collectionhalt
: a function that, when called, ensures no next elements are passed