Is there some kind `onDestroyView` for composable?...
# compose
i
Is there some kind
onDestroyView
for composable? For example here listed example when viewModel value assigning as default parameter in composable function by
viewModel()
call. If i understand correct this factory creates (or returns) view model from activity or fragment scope. But what if i develop single activity app with huge number of features on billions screens? Should i use activity view model scope or i must include fragments to my code or there is better way to handle memory in compose?
i want any composable-related scope that will be destroyed after view goes out from stack
d
You can scope viewmodels to navigation destinations which are composables instead of fragments
i
Checked that.
onCleared
calls when composable goes out from screen, it is perfect!
👍 1
Thanks
d
cool