UNPKG

@thi.ng/transducers-async

Version:

Async versions of various highly composable transducers, reducers and iterators

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