import { AsyncReducer } from "https://deno.land/x/rimbu@0.13.5/core/mod.ts";
const { Base } = AsyncReducer;
A base class that can be used to easily create AsyncReducer
instances.
Constructors
new
Base(init: AsyncOptLazy<S>,
next: () => MaybePromise<S>,
stateToResult: (state: S) => MaybePromise<O>,
onClose?: (state: S, error?: unknown) => MaybePromise<void>,
Methods
collectInput<I2>(collectFun: AsyncCollectFun<I2, I>): AsyncReducer<I2, O>
dropInput(amount: number): AsyncReducer<I, O>
filterInput(pred: () => MaybePromise<boolean>): AsyncReducer<I, O>
mapInput<I2>(mapFun: (value: I2, index: number) => MaybePromise<I>): AsyncReducer<I2, O>
mapOutput<O2>(mapFun: (value: O) => MaybePromise<O2>): AsyncReducer<I, O2>
sliceInput(from?, amount?: number): AsyncReducer<I, O>
takeInput(amount: number): AsyncReducer<I, O>