Library API
    Preparing search index...

    Function defineLazy

    • Defines a lazy getter on target that caches its computed value as an own read-only property on first access.

      Type Parameters

      • T extends object
      • V = unknown

      Parameters

      • target: T

        Object to attach the lazy property to

      • key: PropertyKey

        Property key or symbol

      • factory: (this: T) => V

        Computation evaluated on first access with this bound to the receiver

      • enumerable: boolean = true

        Whether the property is enumerable (default true)

      Returns T

      The target object