Kotlin State & Shared Flows in Action
summary
Concrete rules and examples for using Kotlin coroutines flows: stateFlow caches latest and requires a default value and .value updates; sharedFlow supports replay, extra buffer capacity, and exposes subscriptionCount as a StateFlow and does not complete normally; guidance to migrate BroadcastChannel code mapping send→emit and trySend→tryEmit; how to convert cold flows with shareIn using whileSubscribed, eagerly, or lazily; and buffer overflow strategies with explicit choices suspend, dropOldest, dropLatest.
AI-written summary · about
chapters (9)
- 0:00Start
- 0:26Kotlin State & Shared Flows in Action
- 1:24What is a cold stream?
- 2:54Hot Streans
- 5:53State Flow vs Live Data
- 6:49State Flow Sunnary
- 18:33Sharing Policies
- 20:21Properties
- 25:44Buffering Overflow Strategies








