Hi there, I'm switching from kodein to koin on my ...
# koin
v
Hi there, I'm switching from kodein to koin on my ktor application. Previously I've created an extension function to make the Application class available to
KodeinAware
classes to inject it. Is it possible to have access to the
Application
instance from my managed instances in koin?
t
possibly you can have following module:
Copy code
fun applicationModule(app: Application) = module {
    single { app }
}
and provide your application instance on starting the koin
👍 1
v
thanks 🙂
a
no need to declare it in a module, the
startKoin()
from
koin-android
take
Context
and
Application
instances available for you. Just need to inject it when needed 🙂
t
but he is using ktor 🙂
a
ho sorry ...
😄
t
Will it make sense to have the same approach for
koin-ktor
, that you've described for
koin-android
?
a
To be honest ... don’t know well, as I’m not a fulltime user of Ktor 😕