InsertKoinIO / koin

Koin - a pragmatic lightweight dependency injection framework for Kotlin & Kotlin Multiplatform
https://insert-koin.io
Apache License 2.0
8.77k stars 695 forks source link

feat: getAll by type and qualifier predicate #1820

Open monosoul opened 3 months ago

monosoul commented 3 months ago

This PR introduces <reified T : Any> getAll(qualifierPredicate: (Qualifier?) -> Boolean) method to get all instances of the specified type matching the given qualifier predicate.

This is convenient when you have multiple instances of the same type and only want to get a subset of those instances based on the qualifier.