called more than once?
what am missing here?
this can be related to other things in the app like DI setup for this etc. but I want to check is there something am missing about
rememberSaveable
c
Colton Idle
11/21/2022, 1:32 PM
LaunchedEffect(Unit) { viewModel.onCreate() }
?
m
Marko Novakovic
11/21/2022, 1:32 PM
if user goes to next screen and comes back it will trigger again
c
Colton Idle
11/21/2022, 1:58 PM
You can just use the ViewModels init block? thats what i do when i need something to happen just "once"
m
Marko Novakovic
11/21/2022, 1:58 PM
I don’t want side effects 😄
c
Colton Idle
11/21/2022, 1:59 PM
yeah. im not in love with init blocks either, but i haven't found another way. hopefully someone else responds here so I can learn something new too. 😄