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

Опубликовано: 09 Октябрь 2024
на канале: CodingWithMitch
47,034
1.5k

The BEST android courses in the world: https://codingwithmitch.com/

In this video I 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: https://github.com/mitchtabian/MVVMRe...

Follow me:
Instagram:   / codingwithmitch  
Twitter:   / mitch_tabian  
.
.