Function FactoryKey

  • A specialized form of TypeKey that resolves a function of the form (...args: Args) => T.

    Type Parameters

    • T

    • Args extends any[] = []

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

  • Type Parameters

    • T

    • Args extends any[]

    Parameters

    • fac: ((...args) => T)

      A default value for the factory function

        • (...args): T
        • Parameters

          • Rest ...args: Args

          Returns T

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

  • Type Parameters

    Parameters

    • deps: K

      A DependencyKey specifying dependencies of the factory function. Since the factory returns synchronously, deps must resolve synchronously as well. If deps cannot be resolved synchronously, consider AsyncFactoryKey.

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

      A function that accepts the specified dependency followed by Args

        • (deps, ...args): T
        • Parameters

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

          Returns T

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

Generated using TypeDoc