MicroUtils/koin/src/jvmMain/kotlin/FactoryWithBindsAndRandomQualifier.kt

14 lines
462 B
Kotlin
Raw Normal View History

2022-09-14 16:14:20 +00:00
package dev.inmo.micro_utils.koin
import org.koin.core.definition.Definition
import org.koin.core.instance.InstanceFactory
import org.koin.core.module.Module
import kotlin.reflect.KClass
inline fun <reified T : Any> Module.factoryWithRandomQualifierAndBinds(
bindFilter: (KClass<*>) -> Boolean = { true },
noinline definition: Definition<T>
): Pair<Module, InstanceFactory<*>> {
2022-09-14 16:21:30 +00:00
return factoryWithBinds(RandomQualifier(), bindFilter, definition)
2022-09-14 16:14:20 +00:00
}