Class LazyCall<T>

LazyCall Evaluation Wrapper.

Allows delayed computation with functional transformations.

Type Parameters

  • T

    The type of the computed value.

Constructors

Methods

Constructors

  • Constructs a new LazyCall instance with a computation.

    Type Parameters

    • T

    Parameters

    • computation: (() => T)

      The function to compute the value lazily.

        • (): T
        • Returns T

    Returns LazyCall<T>

Methods

  • Transforms the stored value without evaluating it immediately.

    Type Parameters

    • U

      The new transformed type.

    Parameters

    • fn: ((value: T) => U)

      The transformation function.

        • (value): U
        • Parameters

          • value: T

          Returns U

    Returns LazyCall<U>

    A new lazy instance with the transformation applied.