@adviser/cement - v0.0.0
    Preparing search index...

    Class AsyncResolveOnce<T, CTX>

    Type Parameters

    • T
    • CTX

    Implements

    Index

    Constructors

    Accessors

    Methods

    Constructors

    Accessors

    • get queueLength(): number

      Returns the total number of queued futures across all items.

      Returns number

    • get value(): T | undefined

      Gets the cached resolved value if available.

      Returns T | undefined

    • get error(): Error | undefined

      Gets the cached error if one occurred.

      Returns Error | undefined

    Methods

    • Executes the async function once and caches the result. Subsequent calls return the cached promise without re-executing.

      Type Parameters

      • RET

      Parameters

      • fn: () => RET

        The async function to execute

      Returns ResultOnce<RET>

      A promise that resolves to the function's result