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

@@ -3,6 +3,21 @@ package dev.inmo.micro_utils.koin
import org.koin.core.Koin
import org.koin.core.scope.Scope
/**
* Retrieves all instances of type [T] from the current [Scope] and returns them as a distinct list.
* This function is useful when you want to avoid duplicate instances of the same type.
*
* @param T The type of instances to retrieve
* @return A list of distinct instances of type [T]
*/
inline fun <reified T : Any> Scope.getAllDistinct() = getAll<T>().distinct()
/**
* Retrieves all instances of type [T] from the [Koin] container and returns them as a distinct list.
* This function is useful when you want to avoid duplicate instances of the same type.
*
* @param T The type of instances to retrieve
* @return A list of distinct instances of type [T]
*/
inline fun <reified T : Any> Koin.getAllDistinct() = getAll<T>().distinct()