map
import { map } from "https://github.gh-proxy.cn/raw.githubusercontent.com/baetheus/fun/main/async_iterable.ts";Apply a function to each value in an AsyncIterable.
@example
import { map } from "./async_iterable.ts";
import { fromIterable } from "./async_iterable.ts";
import { pipe } from "./fn.ts";
const numbers = fromIterable([1, 2, 3, 4, 5]);
const doubled = pipe(
numbers,
map(n => n * 2)
);
for await (const value of doubled) {
console.log(value); // 2, 4, 6, 8, 10
}
function map<A, I>(fai: (a: A) => I | PromiseLike<I>): (ta: AsyncIterable<A>) => AsyncIterable<I>;