Suppose I have an android library common module with a single koin module specified. Suppose also I would like to run some code (also specified in common module) when that koin module is loaded. Where is the best place to put such code (note: this should not be explicitly called from outside common)?
a
arnaud.giuliani
02/13/2020, 8:04 AM
you can use
createdAtStart
on a definition to create a component instance when loading it
arnaud.giuliani
02/13/2020, 8:04 AM
else, there is no start hook
m
Mark
02/13/2020, 8:13 AM
Thanks Arnaud, that’s good to know. At the moment, in my common Android library module, I declare
fun loadCommonModules()
in which I call
loadKoinModules()
and also run some code to initialise other aspects of the android library module (eg. configuring logging which is independent of Koin). loadCommonModules() is called from within the