I was reading this article regarding setting up Android Modules with Koin, and noticed that they do loadKoinModules/unloadKoinModules in Activity onCreate/onDestroy. Is this an unusual way to use Koin? I assumed you just set everything up during
I think the idea is if you have a separate feature module and you want to inject things that are specific to that module and not available in your core app module, then you need to load those at that module’s point of entry (Android library modules, not Koin modules)
Matt Thompson
02/17/2020, 2:55 PM
I’ve only used Koin with a monolithic app, so doing everything in
startKoin
still works in that case
a
arnaud.giuliani
02/19/2020, 8:33 AM
load/unload modules is a convenient way to deal with a global bunch of definitions
arnaud.giuliani
02/19/2020, 8:33 AM
I woudn’t recommend to load/unload modules on the fly on each Activity/Fragment, better use the Scope API for that