Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/ahh/src/iterator.ts>fromIter

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

Creates an Iterator that yields the next item from an iter that conforms to the iteration protocols.

Examples

Example 1

import { assert } from "../test_deps.ts";
import I from "./iterator.ts";

let i = 0;
const iter = I.fromIter([1, 2]);

assert(iter.next() === 1);
assert(iter.next() === 2);
assert(iter.next() === undefined);

Type Parameters

T extends Some<unknown>

Parameters

iter: Iterable<T>

Returns

Iterator<T>