DependencyContainer - Andrei15193/react-model-view-viewmodel GitHub Wiki
API / DependencyContainer class
Represents a dependency container for configuring and later on resolving dependencies similar to a dependency injection mechanism.
Implements IDependencyContainer, IDependencyResolver.
class DependencyContainer
implements IDependencyContainer, IDependencyResolver
Source reference: src/dependencies/DependencyContainer.ts:9
.
-
constructor - Initializes a new instance of the
DependencyContainer
class.
- createScope - Creates a scoped dependency resolver. All scoped configured dependencies are resolved for each scope individually,
- registerInstanceToToken - Registers the provided instance for the given token.
- registerScopedFactoryToToken - Registers the provided callback for the given token as a scoped dependency.
- registerScopedType - Registers the provided type as a scoped dependency.
- registerScopedTypeToToken - Registers the provided type for the given token as a scoped dependency.
- registerSingletonFactoryToToken - Registers the provided callback for the given token as a singleton dependency.
- registerSingletonType - Registers the provided type as a singleton dependency.
- registerSingletonTypeToToken - Registers the provided type for the given token as a singleton dependency.
- registerTransientFactoryToToken - Registers the provided callback for the given token as a transient dependency.
- registerTransientType - Registers the provided type as a transient dependency.
- registerTransientTypeToToken - Registers the provided type for the given token as a transient dependency.
- resolve - Resolves a dependency based on its configuration, if any. All unconfigured dependencies are transient.
- DependencyContainer