Thinking on dynamic modules usage, with `loadKoinM...
# koin
p
Thinking on dynamic modules usage, with
loadKoinModules
and
unloadKoinModules
. I want to confirm an information, looking for specific use case using Android Activity with multiple fragments. So
loadKoinModules()
need to be called previous of
super.onCreate(bundle)
and
unloadKoinModules
after
super.onDestroyu()
, @arnaud.giuliani?
a
yes 👍
I will automate it for Jetpack Compose
p
Thanks to the awnser, Arnaud. I'm thinking in create a logic with lifecycle callback and possible combining with kotlin delegates to handle these cases. Do you think is It a good Idea? I'm supposing you have been tried it before.
a
yes, would be the same as opening/closing scopes but for modules. In previous 2.x there where something like this
I need to check if child/parent modules with includes are loaded in the good way
p
Nice, it will be helpful because in the project I’m working on, that it’s a superapp, has 90% of dynamic module usage. 💪
a
super interesting, keep me in touch 👍
p
@arnaud.giuliani about where is recommended to use load/unload in onCreate/onDestroy, can I include this information in docs?
a
on start of onCreate & end of onDestroy, basically
but after it depends how you play with it
138 Views