• Creates an infinite list with value.

    Type Parameters

    • T

    Parameters

    • value: T

      The element generator.

    Returns List<T>

    The infinite list with value element.

    Examples

    import { repeat, toIterator } from "./list.ts";
    import { assertEquals } from "../deps.ts";

    const iter = toIterator(repeat(13));
    assertEquals(iter.next(), { value: 13, done: false });
    assertEquals(iter.next(), { value: 13, done: false });
    assertEquals(iter.next(), { value: 13, done: false });
    assertEquals(iter.next(), { value: 13, done: false });

Generated using TypeDoc