hey folks, what is the best "compose" way of calli...
# compose
i
hey folks, what is the best "compose" way of calling suspended functions to return data for display, should I still use the
ViewModel
approach or is there a better way that still has the same benefits (such as surviving state changes) of using VM approach?
c
you can keep doing almost like classic android MVVM where you call suspend funs in
viewModelScope
n
Yeah set up the ViewModel as normal and then use observeAsState https://developer.android.com/jetpack/compose/state#viewmodel-and-jetpack-compose
2