add kdocs to koin common module

This commit is contained in:
2025-04-14 10:03:26 +06:00
parent 5ec0a46089
commit 9c463d0338
8 changed files with 122 additions and 4 deletions

View File

@@ -4,8 +4,14 @@ import org.koin.core.definition.Definition
import org.koin.core.module.Module
/**
* Will be useful in case you need to declare some singles with one type several types, but need to separate them and do
* not care about how :)
* Declares a factory with a random qualifier in the Koin module.
* This is useful when you need to declare multiple factory definitions of the same type
* but want them to be uniquely identifiable without manually specifying qualifiers.
* Unlike singles, factories create a new instance each time they are requested.
*
* @param T The type of instance to be created by the factory
* @param definition The definition function that creates new instances
* @return A Koin definition for the factory with a random qualifier
*/
inline fun <reified T : Any> Module.factoryWithRandomQualifier(
noinline definition: Definition<T>