@lppedd/di-wise-neo - v0.11.1
    Preparing search index...

    Function optionalBy

    • Injects the instance associated with the given class, or undefined if the class is not registered in the container.

      Compared to optional, optionalBy accepts a thisArg argument (the containing class) which is used to resolve circular dependencies.

      Type Parameters

      • Instance extends object

      Parameters

      • thisArg: any

        The containing instance, used to help resolve circular dependencies.

      • Class: Constructor<Instance>

        The class to resolve.

      • Optionalname: string

        The name qualifier of the class to resolve.

      Returns undefined | Instance

    • Injects the value associated with the given token, or undefined if the token is not registered in the container.

      Compared to optional, optionalBy accepts a thisArg argument (the containing class) which is used to resolve circular dependencies.

      Type Parameters

      • Value

      Parameters

      • thisArg: any

        The containing instance, used to help resolve circular dependencies.

      • token: Token<Value>

        The token to resolve.

      • Optionalname: string

        The name qualifier of the token to resolve.

      Returns undefined | Value