react-async-iterators
Version:
The magic of JavaScript async iterators in React ⛓️ 🧬 🔃
12 lines (11 loc) • 345 B
TypeScript
export { iterateAsyncIterWithCallbacks, type EndIterationFn };
declare function iterateAsyncIterWithCallbacks<T>(iterable: AsyncIterable<T>, initialValue: T, changeCb: (change: {
value: T;
} & ({
done: false;
error: undefined;
} | {
done: true;
error: unknown;
})) => void): EndIterationFn;
type EndIterationFn = () => void;