ktp / toothpick.ktp.binding / CanBeBound / toInstance

toInstance

fun toInstance(instance: T): Unit

DSL method to associate an instance to a binding, more Kotlin friendly.

Parameters

instance - to be used

Return
a binding statement for this key, with the instance provided by the lambda that can be further customized.

fun toInstance(instanceProvider: () -> T): Unit

DSL method to associate an instance to a binding, more Kotlin friendly.

Parameters

instanceProvider - a lambda that creates the instance

Return
a binding statement for this key, with the instance provided by the lambda that can be further customized.