Demystifying Molecule: Running Your Own Compositions For Fun And Profit
summary
Shows how Compose’s runtime can run headless so business logic emits testable streams: molecule turns composables into flows by creating a Recomposer, supplying a no-op Applier and a FrameClock, conflating invalidation events into a single apply. Exposes both Flow (cold) and StateFlow (hot) APIs, which pair with Turbine for deterministic unit tests. Recommends using the immediate clock for fast unit tests, and explains using ViewModel or rememberSaveable for persistence; the approach is simple and it works.
AI-written summary · about
chapters (10)
- 0:00Introduction and motivation
- 1:32What is Jetpack Compose
- 6:07Reactive programming challenges
- 10:18Coroutines and Flow improvements
- 13:03Compose beyond UI
- 17:37How Molecule works internally
- 23:00Testing Molecule flows
- 27:11Architecture with Compose
- 31:52Modern Compose libraries
- 33:17Closing and resources








