@esfx/async-iter-fromsync Package
An API to convert an ECMAScript Iterable into an AsyncIterable.
Installation
npm i @esfx/async-iter-fromsync
Usage
import { toAsyncIterable } from "@esfx/async-iter-fromsync";
async function f<T>(source: AsyncIterable<T> | Iterable<T | PromiseLike<T>>) {
const asyncIterable = toAsyncIterable(source);
// ...
}
Functions
toAsyncIterable(source)
Creates an AsyncIterable
from a synchronous Iterable
.
Declaration
export declare function toAsyncIterable<T>(source: AsyncIterable<T> | Iterable<PromiseLike<T> | T>): AsyncIterable<T>;
Type Parameters
- T
Parameters
- source
- AsyncIterable<T> | Iterable<PromiseLike<T> | T>