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

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

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

Creates an Iterator that will iterate over two other Iterators sequentially.

Examples

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

const iter = I.chain(I.iter([1, 2]), I.once(3));

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

Parameters

iterA: Iterator<T>
iterB: Iterator<T>

Returns

Iterator<T>