UNPKG

axax

Version:

A library of async iterator extensions for JavaScript including ```map```, ```reduce```, ```filter```, ```flatMap```, ```pipe``` and [more](https://github.com/jamiemccrindle/axax/blob/master/docs/API.md#functions).

11 lines (10 loc) 458 B
/** Provides a way for callbacks to signal early completion */ export declare class StopError extends Error { } /** * Converts an async iterable into a series of callbacks. The function returns * a promise that resolves when the stream is done * * @param callback the callback that gets called for each value */ export declare function toCallbacks<T>(callback: (result: IteratorResult<T>) => Promise<void>): (source: AsyncIterable<T>) => Promise<void>;