Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "gen/iterable"

Index

Classes

Functions

Functions

Const iterable

  • iterable<T>(src: Iterable<T>, initial: T): $Iterable<T>
  • Wraps given ES6 iterable to provide full IGen implementation.

    remarks

    Calling .next() on this wrapped instance will always succeed, even if the original iterable already is exhausted (in which case the last valid value will be repeated ad infinitum).

    The initial value is required to satisfy .deref() and the case where the iterable doesn't provide a single value.

    Type parameters

    • T

    Parameters

    • src: Iterable<T>
    • initial: T

    Returns $Iterable<T>

Generated using TypeDoc