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

iterable

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

Create an Iterable from a function that returns an Iterator.

@example
import * as I from "./iterable.ts";

const numbers = I.iterable(function* () {
  yield 1;
  yield 2;
  yield 3;
});

const result = Array.from(numbers);
// [1, 2, 3]
function iterable<A>(fa: () => Iterator<A>): Iterable<A>;
§
iterable<A>(fa: () => Iterator<A>): Iterable<A>
[src]

§Type Parameters

§Parameters

§
fa: () => Iterator<A>
[src]

§Return Type

§
Iterable<A>
[src]