vkuznetsov
07/16/2020, 5:32 PMnamed
qualifier. (The idea is that I want to get A
by named qualifier Q
. But to create A
I need B
that is also registered with Q
) So I'm currently experiencing an issue that when receiving the binding by named
qualifier it doesn't use class clarifier as an addition to named
qualifier. I'm currently using koin 2.0.1 Here is the source code in Koin that seems does the bindings resolving for me:
/**
* Find a definition
* @param qualifier
* @param clazz
*/
fun findDefinition(
qualifier: Qualifier? = null,
clazz: KClass<*>
): BeanDefinition<*>? {
return if (qualifier != null) {
findDefinitionByName(qualifier.toString())
} else {
findDefinitionByType(clazz) ?: findDefinitionBySecondaryType(clazz)
}
}
And based on the code I assume it is possible to have only one binding registered with the same-named qualifier value?
I just checked the koin 2.1 release notes, and it seems that scopes
might solve this issue fo me.