Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/ahh/src/iterator.ts>fn

Opinionated idiomatic features for TypeScript.
Go to Latest
function fn
import { fn } from "https://deno.land/x/ahh@v0.12.1/src/iterator.ts";

Creates an Iterator that calls fn each iteration.

Examples

Example 1

import { default as I } from "./iterator.ts";

let i = 0;
const iter = I.fn(() => ++i);

console.log(iter.next());

Parameters

fn: Iterator<T>["next"]