import { type Reducer } from "https://deno.land/x/rimbu@1.0.3/common/mod.ts";
const { Impl } = Reducer;
The Implementation interface for a Reducer
, which also exposes the internal state type.
Methods
Returns a Reducer
instance that only passes values to the reducer that satisy the given pred
predicate.
Returns a Reducer
instance that converts its input values using given mapFun
before passing them to the reducer.
collectInput<I2>(collectFun: CollectFun<I2, I>): Reducer<I2, O>
Returns a Reducer
instance that converts or filters its input values using given collectFun
before passing them to the reducer.
Returns a Reducer
instance that takes at most the given amount
of input elements, and will ignore subsequent elements.