UNPKG

@thi.ng/transducers-async

Version:

Async versions of various highly composable transducers, reducers and iterators

14 lines 812 B
import { type MaybeAsyncIterable } from "@thi.ng/api/async"; import type { AsyncReducer, AsyncReducerInit, AsyncReduction } from "./api.js"; export declare function reduce<A, B>(rfn: AsyncReducer<A, B>, src: MaybeAsyncIterable<A>): Promise<B>; export declare function reduce<A, B>(rfn: AsyncReducer<A, B>, acc: B, src: MaybeAsyncIterable<B>): Promise<B>; /** * Convenience helper for building a full {@link AsyncReducer} using * [asyncIdentity](https://docs.thi.ng/umbrella/api/functions/asyncIdentity.html) * as completion step (true for 90% of all bundled transducers). * * @param init - init step of reducer * @param rfn - reduction step of reducer */ export declare const reducer: <A, B>(init: AsyncReducerInit<B>, rfn: AsyncReduction<A, B>) => AsyncReducer<A, B>; //# sourceMappingURL=reduce.d.ts.map