In this video We show you the best way (for most scenarios) to use an observable data structure in your viewmodels when using jetpack compose. There’s lots of different options: LiveData, StateFlow, SharedFlow, MutableState. But in my opinion for simple scenarios you should be using MutableState. It’s easy to use and is optimized for jetpack compose.

Code: http://bit.ly/3p7dLNu

Subscribe: https://www.youtube.com/channel/UCoNZZLhPuuRteu02rh7bzsw

#jetpack #programming

Persisting data in ViewModels with MutableState (Jetpack Compose ViewModel Example)
6.80 GEEK