bind

inline fun <T> BeanDefinition<out T>.bind()

Add a secondary type binding to this definition. Used within withOptions { } block.

This allows the definition to be retrieved by an additional type, typically an interface or superclass.

Type-safety may be checked by "checkModules" from "koin-test" module.

Example:

single { MyServiceImpl() } withOptions {
bind<ServiceInterface>()
}
// Can retrieve with: get<ServiceInterface>()