Function AsyncFactoryKey

  • A specialized form of TypeKey that resolves an async function of the form (...args: Args) => Promise<T>.

    Type Parameters

    • T

    • Args extends any[] = []

    Returns TypeKeyClass<((...args) => Promise<T>), never>

  • Type Parameters

    • T

    • Args extends any[]

    Parameters

    • fac: ((...args) => T | Promise<T>)

      A default value for the async factory function

        • (...args): T | Promise<T>
        • Parameters

          • Rest ...args: Args

          Returns T | Promise<T>

    Returns TypeKeyClass<((...args) => Promise<T>), ComputedKey.WithDepsOf<((...args) => Promise<T>), void>>

  • Type Parameters

    Parameters

    • deps: K

      A DependencyKey specifying dependencies of the async factory function

    • fac: ((deps, ...args) => T | Promise<T>)

      An async function that accepts the specified dependency followed by Args

        • (deps, ...args): T | Promise<T>
        • Parameters

          • deps: Target<K>
          • Rest ...args: Args

          Returns T | Promise<T>

    Returns TypeKeyClass<((...args) => Promise<T>), ComputedKey.WithDepsOf<((...args) => Promise<T>), Async<K>>>

Generated using TypeDoc