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

clone

import { clone } from "https://github.gh-proxy.cn/raw.githubusercontent.com/baetheus/fun/main/async_iterable.ts";

Create a clone of an AsyncIterable that can be consumed multiple times.

@example
import { clone } from "./async_iterable.ts";
import { fromIterable } from "./async_iterable.ts";

const original = fromIterable([1, 2, 3]);
const cloned = clone(original);

// Both can be consumed independently
for await (const value of original) {
  console.log(value); // 1, 2, 3
}
for await (const value of cloned) {
  console.log(value); // 1, 2, 3
}
function clone<A>(ta: AsyncIterable<A>): AsyncIterable<A>;
§
clone<A>(ta: AsyncIterable<A>): AsyncIterable<A>
[src]

§Type Parameters

§Parameters

§
ta: AsyncIterable<A>
[src]

§Return Type

§
AsyncIterable<A>
[src]