Is there a way to clear the `hiltViewModel()` manu...
# android
o
Is there a way to clear the
hiltViewModel()
manually? How does
onCleared()
gets called when a destination gets popped off the back stack with
hiltViewModel()
in compose?
😶 1
m
I think the only way you can do it is to implement your own custom scope
or scope the viewmodel to a graph f.e. if you want it limited to a certain part of the app
or a fragment, or else
it also might be that the solution you want to apply (manual clear of view model) is not the right thing to do in your scenario but you didn’t give a lot of details to maybe try to approach the problem from some other side