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

fromIterable

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

Convert a synchronous Iterable to an AsyncIterable.

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

const syncArray = [1, 2, 3, 4, 5];
const asyncIter = fromIterable(syncArray);

for await (const value of asyncIter) {
  console.log(value); // 1, 2, 3, 4, 5
}
function fromIterable<A>(ta: Iterable<A>): AsyncIterable<A>;
§
fromIterable<A>(ta: Iterable<A>): AsyncIterable<A>
[src]

§Type Parameters

§Parameters

§
ta: Iterable<A>
[src]

§Return Type

§
AsyncIterable<A>
[src]