Hi guys! Using the following module declaration ...
# koin
c
Hi guys! Using the following module declaration val module = module{ viewModel { MyModule(get()) } // MyModule extends ViewModule } The MyModule object gets created every time it is injected even when I rotate the device. It also doesn’t follow the activity lifecycle, did I do any mistake during the configuration?
n
Hey, I'm no expert, but maybe try the
getSharedViewModel
methods or similar. I think that makes them persist longer. According to the documentation it says it reuses the same model across multiple fragments of a single Activity.
c
Thanks, I'll try it out