alias
Creates an alias entry.
Be careful, this method will not check if a type cast is possible.
Example:
singleton { ReposViewModel(instance()) }
alias(erased<ReposViewModel>(), generic<ViewModel<ReposViewState>>())Content copied to clipboard
Parameters
Throws
Create an alias entry for the UnboundService.
Be careful, this method will not check if a type cast is possible.
Example:
singleton {
ReposViewModel(instance())
}.alias(generic<ViewModel<ReposViewState>>())Content copied to clipboard
Parameters
key
The TypeKey of the alias.
inline fun <R, A : Any, S : UnboundService<R>> S.alias(kClass: KClass<A>, qualifier: Qualifier? = null): S(source)
Create an alias entry for the UnboundService.
Be careful, this method will not check if a type cast is possible.
Example:
singleton {
ReposViewModelImpl(instance())
}.alias(::ReposViewModel)Content copied to clipboard