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

    Function OptionalAll

    • Parameter decorator that injects all instances provided by the registrations associated with the given class or an empty array if the class is not registered in the container.

      Throws an error if a circular dependency is detected.

      Type Parameters

      • Instance extends object

      Parameters

      Returns ParameterDecorator

    • Parameter decorator that injects all values provided by the registrations associated with the given token or an empty array if the token is not registered in the container.

      Throws an error if a circular dependency is detected.

      Type Parameters

      • Value

      Parameters

      Returns ParameterDecorator

    • Parameter decorator that injects all values provided by the registrations associated with the given token or an empty array if the token is not registered in the container.

      Allows referencing a token declared later in the file by using the tokenRef helper function.

      Throws an error if a circular dependency is detected.

      Type Parameters

      • Value

      Parameters

      Returns ParameterDecorator

      class Wizard {
      constructor(@OptionalAll(tokenRef(() => Wand)) readonly wands: Wand[]) {}
      }
      // Other code...
      class Wand {}