okay if you navigate back the launched effect call...
# koin
d
okay if you navigate back the launched effect callback will run even if the state does not change . Can you explain more your problem
u
Example: route - a,b,c,d every route i use Launched effect function for fetching data online and offline(sqlite) naturally when you navigate every route the Launched effect will run - navigate a - b - a(works in factory). However, when you use SINGLE the launched effect will only run once when navigate: a - b - a. I thought single only affect in class - init function will only run once when navigate again.
Does Launched Effect function dependent to composition not the koin dependecy if I'm not using koin and I use Launched effect it will runs every composition In koin factory it the same in default but when I use koin single it didn't run it's affecting the Launched Effect which is getting shared. Only run once. I mean it's getting dependent on the single dependency.
d
it depends on the keys you using in launched effect
try to check the event call maybe the problem in the state . any ways if you are setting Unit as key it will be automatically called . maybe the state does not update
u
yep, I set it Unit but the state didn't update
d
cool the problem is in state management , try to update the state on the main thread some time does not work if you update on io
u
But if I use factory rather than single instance it will update the state
d
are you using voyager ??
if yes try to override the key of the Screen class of those screens some times this cause a problem for me in navigation
u
yes but for screen only not using screenmodel I'm using viewModel
😓 1
ok tnx