Container is a root object of the DI system.

Constructors

Properties

dynamicModules: Set<Module<any>> = ...
globalFactoryRefs: Map<Module<any>, Set<TBindKey>> = ...
globalRefWaiters: Map<TBindKey, Set<(() => unknown)>> = ...
modules: Set<Module<any>> = ...

Methods

  • Registers a new module in the container.

    Type Parameters

    • M extends Module<any>
    • Cfg = M extends Module<C>
          ? C
          : any

    Parameters

    • module: TClassConstructor<M>
    • Optional configure: null | ((container, module) => Cfg | Promise<Cfg>)
    • Optional options: {
          skipInitPhase?: boolean;
      }
      • Optional skipInitPhase?: boolean

    Returns Promise<M>