Can anyone recommend a pragmatic approach to resol...
# koin
j
Can anyone recommend a pragmatic approach to resolving dependency based on a given KCLass as a way to do runtime dependency — I am unable to utilize named dependency as I need to retain the ability to resolve based solely on type — when the name is unknown
Any suggestions
a
what API do you want to use?
normal one with
get<T>()
?
j
@arnaud.giuliani thanks for the response -not sure u am tracking on the which api question however for the example you provided you would have know the type of the class….my use case is given a Foo::class object how would I resolved it from the dependency cache
a
from where do you want to resolve it?
j
Inside a KoinComponent
a
then you have acces to
getKoin
and
get()
function with KClass param