import { fromFn } from "https://deno.land/x/ahh@v0.14.0/src/iterator.ts";
Creates an Iterator
that yields the result of fn
each
iteration.
Examples
Example 1
Example 1
import { assert } from "../test_deps.ts";
import I from "./iterator.ts";
let i = 0;
const iter = I.fromFn(() => i++);
assert(iter.next() === 0);
assert(iter.next() === 1);
assert(iter.next() === 2);
Type Parameters
T extends Some<unknown>