Lucas
05/12/2023, 6:34 PMArkadii Ivanov
05/12/2023, 6:52 PMArkadii Ivanov
05/12/2023, 6:52 PMLucas
05/12/2023, 7:08 PM@Composable
fun lifeCycleComposable(
content: @Composable LifecycleRegistry.() -> Unit
) {
val registry = LifecycleRegistry()
LaunchedEffect(Unit){
registry.onCreate()
registry.onStart()
}
DisposableEffect(Unit){
onDispose {
registry.onDestroy()
}
}
with(registry){
content()
}
}
might be useful, right?
I'm trying to find a solution for destroying my viewmodels that i inject with koin because right now i think they're not being disposed, not sure i'm on the right track tho 😅Arkadii Ivanov
05/12/2023, 7:24 PM