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>;