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

collect

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

Collect all values from an AsyncIterable into an array.

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

const numbers = fromIterable([1, 2, 3, 4, 5]);
const array = await collect(numbers);

console.log(array); // [1, 2, 3, 4, 5]
async function collect<A>(ta: AsyncIterable<A>): Promise<ReadonlyArray<A>>;
§
collect<A>(ta: AsyncIterable<A>): Promise<ReadonlyArray<A>>
[src]

§Type Parameters

§Parameters

§
ta: AsyncIterable<A>
[src]

§Return Type

§
Promise<ReadonlyArray<A>>
[src]