mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2026-04-02 23:52:53 +00:00
add RandomQualifier
This commit is contained in:
@@ -1,10 +1,7 @@
|
||||
package dev.inmo.micro_utils.koin
|
||||
|
||||
import com.benasher44.uuid.uuid4
|
||||
import org.koin.core.definition.Definition
|
||||
import org.koin.core.instance.InstanceFactory
|
||||
import org.koin.core.module.Module
|
||||
import org.koin.core.qualifier.StringQualifier
|
||||
|
||||
/**
|
||||
* Will be useful in case you need to declare some singles with one type several types, but need to separate them and do
|
||||
@@ -12,4 +9,4 @@ import org.koin.core.qualifier.StringQualifier
|
||||
*/
|
||||
inline fun <reified T : Any> Module.factoryWithRandomQualifier(
|
||||
noinline definition: Definition<T>
|
||||
) = factory(uuid4().toString(), definition)
|
||||
) = factory(RandomQualifier(), definition)
|
||||
|
||||
Reference in New Issue
Block a user