@metreeca/core - v0.9.22
    Preparing search index...

    Function lazy

    • Defers a value to first use.

      Wraps a Lazy reference in a no-arg accessor that computes a deferred value on the first call and reuses the result thereafter, so work the caller may never need is neither done upfront nor repeated; a plain value has nothing to defer, and the accessor simply hands it back.

      Type Parameters

      • T extends {}

        The type of the deferred value, which may be neither null nor undefined

      Parameters

      • value: Lazy<T>

        The value, or the no-arg factory computing it, called at most once

      Returns () => T

      An accessor returning the value, computing it on the first call

      eager for the converse, forcing a Lazy reference rather than deferring it