UNPKG

@thi.ng/transducers-async

Version:

Async versions of various highly composable transducers, reducers and iterators

11 lines (10 loc) 199 B
import { wait } from "./delayed.js"; async function* asAsyncIterable(src, delay = 0) { for (const x of src) { yield x; if (delay > 0) await wait(delay); } } export { asAsyncIterable };