Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

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>;
§
repeat(n: number): <A>(ta: AsyncIterable<A>) => AsyncIterable<A>
[src]

§Parameters

§
n: number
[src]

§Return Type

§
<A>(ta: AsyncIterable<A>) => AsyncIterable<A>
[src]