LiveData<🤖> vs Observable<Rx> vs Channel<Kt> (minimal slides)
All these classes can be used to handle a flow of data in your Android app. This presentation goes through a specific use case, and how these classes differ in their implementations of managing and observing data.
onCreate(savedInstanceState: Bundle?) { launch { userViewModel.stateFlow .collect { state -> updateUi(state) } } } } All coroutines in scope cleaned up by coroutineContext.cancelChildren()
Auto Fully Manual Nullable Always Configurable Scope UI Only Anywhere Saves Last Value Yes Configurable Threading UI Only Mostly Easy Stable / Reliable Yes Yes Guides / Docs Good Meh Multiplatform No Sorta
Lifecycle/Cleanup Fully Auto Fully Manual Semi-Auto Nullable Always Configurable IDE-enforced Scope UI Only Anywhere Anywhere Saves Last Value Yes Configurable Configurable Threading UI Only Mostly Easy Easy Stable / Reliable Yes Yes Sorta Guides / Docs Good Meh Quality, but few Multiplatform No Sorta Mostly
Everyone* Final Rating Team Setup? Small / New Large Production App Supportive team Any setup* All Future Kotlin Apps ⏳ *Willing to accept risk of cutting edge