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,6 +4,16 @@ import org.koin.core.definition.Definition
import org.koin.core.module.Module
import org.koin.core.qualifier.StringQualifier
/**
* Declares a single instance with a string qualifier in the Koin module.
* This is a convenience function that wraps the string qualifier in a [StringQualifier].
*
* @param T The type of instance to be created
* @param qualifier The string value to be used as a qualifier
* @param createdAtStart Whether the instance should be created when the Koin module starts (default: false)
* @param definition The definition function that creates the instance
* @return A Koin definition for the single instance with the specified string qualifier
*/
inline fun <reified T : Any> Module.single(
qualifier: String,
createdAtStart: Boolean = false,