`ViewModel` as it is, for surviving configuration ...
# compose
m
ViewModel
as it is, for surviving configuration change isn’t really needed in
Compose
. Right?
Compose
has it’s own
by saveInstanceState
. do we still use
ViewModel
as we have been using it until now?
d
Yup you don't need it for surviving configuration changes. (Other uses still remain though.)
m
sure, thanks
n
But you still need to make the VM parcelable or some sort, because of how
saveInstanceState
works, no?
j
you don't have to make the whole VM parcelable, you only need to save the state somehow
n
Yeah, but still IMO doesn't scale as well 🤔
i
Saved instance state is tiny amounts of data (think, the key of a selected item). That's a totally different use case than what non-config state and ViewModels are for (caching the list of data from your repository layer so that it is instantly available to your UI after a config change)
👌 2
👍 1