Turns an iterator of promises into an async iterator. Handy if you need to map items into async results, or if you have an array of promises and want to iterate through the results.
import { async, pipe, sync } from "yta";import { asAsync } from "yta/sync";await pipe(sync.range(5), asAsync(), async.toArray());// => [0, 1, 2, 3, 4] Copy
import { async, pipe, sync } from "yta";import { asAsync } from "yta/sync";await pipe(sync.range(5), asAsync(), async.toArray());// => [0, 1, 2, 3, 4]
Turns an iterator of promises into an async iterator. Handy if you need to map items into async results, or if you have an array of promises and want to iterate through the results.