Hey guys, I've used kodein on the backend before, ...
# kodein
r
Hey guys, I've used kodein on the backend before, but am new to using it on Android/KMP. I have a dependency which needs an
applicationContext
to initialize (SQLDelight android SqlDriver). Scopes seem the right way to do that, but I don't see anything like ApplicationScope available.
Ok, looks like I just have to import
androidXModule
and then I have a
Context
instance available for injection... seems to work, but is that the right approach?
r
Yes it is the right way to do it. If your doing a KMM application you can also take a look at Kodein-DB to manage data persistence on iOS and Android https://docs.kodein.org/kodein-db/0.3.0/index.html
👍 1