Hey guys, I'm currently trying to implement an app...
# koin
v
Hey guys, I'm currently trying to implement an approach with dynamic bindings, where the binding is registered by
named
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:
Copy code
/**
     * 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.