DependencyProvider

Represents a provider for managing dependencies in a dependency injection mechanism. This interface allows the registration of dependency initializers and the retrieval or instantiation of declared dependencies based on their unique keys.

Report a problem

Inheritors

Functions

Link copied to clipboard
inline fun <T> DependencyProvider.provide(name: String? = null, noinline provide: DependencyResolver.() -> T?)

Basic call for providing a dependency, like provide<Service> { ServiceImpl() }.

Link copied to clipboard
abstract fun <T> set(key: DependencyKey, value: suspend DependencyResolver.() -> T)

Associate the given dependency key with the corresponding initializer.