Migrating from LiveData to Coroutines and Flow
summary
Investigation finds UI jank caused by LiveData dispatches observers on main thread via Transformations.map and MediatorLiveData, so code refactors replace repository LiveData with suspend functions and retrofit coroutine support, add migration helpers that use liveData builder with a Dispatcher, move heavy mapping into ViewModel, convert streams to Flow and state to MutableStateFlow + StateFlow, and verify with unit tests using Turbine; migration removes main‑thread blocks and simplifies execution‑context control.
AI-written summary · about
chapters (6)
related talks
24mUsing Kotlin Flow in MVVM
33mFlowing Things, not so strange in the MVI world
44mGoing with the Flow - Using Coroutines 1.3.x
37mFlowing Things, Not So Strange in the MVI World
48mHow do LiveData and Coroutines actually work
36mCoroutine + Flow = MVI
43mBattle of the Titans: RxJava vs Kotlin Coroutines
33mJUnit 5 Testing: Android Unidirectional Data Flow with LiveData
