Function useSingleton

Returns a singleton instance of a given value or a function that creates the value.

  • Type Parameters

    • T = undefined

      The type of the value to be returned.

    Parameters

    • value: T | (() => T)

      The value or function that creates the value.

    Returns T

    The singleton instance of the value.