provide

inline fun <T : Any> provide(kClass: KClass<out T>): DependencyRegistry.KeyContext<T>(source)

Provides an instance of the dependency associated with the specified kClass.

Uses the create method from the DependencyResolver to resolve and instantiate a dependency of type T specified by the given kClass.

Report a problem

Parameters

T

The type of the dependency to be provided.

kClass

The KClass representing the type of the dependency to be created or resolved.


inline fun <T> provide(name: String? = null, noinline provide: suspend DependencyResolver.() -> T?): DependencyRegistry.KeyContext<T>(source)

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

Report a problem