Function generate

  • Generates an iterable sequence by running a state-driven loop producing the sequence's elements.

    Type Parameters

    • TState

      The type of the state used in the generator loop.

    • TResult

      The type of the elements in the produced sequence.

    Parameters

    • initialState: TState

      The initial state.

    • condition: ((value) => boolean)

      Condition to terminate generation (upon returning false).

        • (value): boolean
        • Parameters

          • value: TState

          Returns boolean

    • iterate: ((value) => TState)

      Iteration step function.

        • (value): TState
        • Parameters

          • value: TState

          Returns TState

    • resultSelector: ((value) => TResult)

      Selector function for results produced in the sequence.

        • (value): TResult
        • Parameters

          • value: TState

          Returns TResult

    Returns Iterable<TResult>

    The generated iterable sequence.

Generated using TypeDoc