Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/ahh/src/iter/mod.ts>I.once

Idiomatic type-safety structures for TypeScript.
Go to Latest
method I.once
import { I } from "https://deno.land/x/ahh@v0.10.0/src/iter/mod.ts";

Creates an Iterator that returns exactly one item.

Examples

import { I } from "./mod.ts";

const iter = I.once(1);

console.log(iter.next()); // 1
console.log(iter.next()); // undefined