repeat
import { repeat } from "https://github.gh-proxy.cn/raw.githubusercontent.com/baetheus/fun/main/async_iterable.ts";Repeat an AsyncIterable a specified number of times.
@example
import { repeat } from "./async_iterable.ts";
import { fromIterable } from "./async_iterable.ts";
import { pipe } from "./fn.ts";
const numbers = fromIterable([1, 2, 3]);
const repeated = pipe(
numbers,
repeat(3)
);
for await (const value of repeated) {
console.log(value); // 1, 2, 3, 1, 2, 3, 1, 2, 3
}
function repeat(n: number): <A>(ta: AsyncIterable<A>) => AsyncIterable<A>;