Migrating to Kotlin State & Shared Flows
summary
Covers concrete migration steps: replace deprecated BroadcastChannel with Shared Flow using emit/tryEmit, map capacity to extraBufferCapacity, and set replay (default 0, replay 1 returns last value to late subscribers). Shows creating UI streams via State Flow or flow.shareIn/stateIn with start policies (eager, lazy, whileSubscribed). Demonstrates Molecule (Compose compiler) producing StateFlows, and gives three backpressure strategies with numbers: suspend (default), dropOldest, dropLatest and buffer examples like cache size 2 or 3.
AI-written summary · about
chapters (10)
- 0:00Introduction to talk
- 0:48Cold vs hot flows explained
- 3:41State flow fundamentals
- 10:30Flow combine for UI states
- 11:33Molecule library approach
- 17:11Shared flow deep dive
- 22:51Migrating from broadcast channels
- 25:42Flow sharing strategies
- 32:26Managing back pressure
- 34:53Summary and resources








