Demystifying Molecule: Running Your Own Compositions For Fun And Profit
summary
Molecule turns a Composable into an asynchronous stream by running a recomposer + composition with a no‑op applier, observing snapshot state via a conflated channel, and emitting values as a Flow; it exposes moleculeFlow (cold back‑pressured flow) and launchMolecule (state flow) and uses an immediate frame clock in tests so recomposition isn’t racy. Cash App uses it in production, tests use Turbine, and the approach simplifies combining state and job management.
AI-written summary · about
chapters (12)
- 0:00Introduction
- 1:59Compose UI basics
- 5:30Separating UI and logic
- 8:41From callbacks to RxJava
- 13:55Kotlin coroutines and flows
- 17:43Compose without UI
- 22:05Building Molecule runtime
- 28:24Key Molecule concepts
- 31:55Testing with Molecule
- 35:47Architecture with Compose
- 39:16Alternatives and libraries
- 40:39Wrap-up and resources
related talks
26mMolecule: Using Compose for Presentation Logic
27mBuilding State Holders in Compose with Molecule
42mCompose: Beyond Android development
34mBeyond the UI: Compose as a Foundation for Multiplatform Apps
30mModern Compose Architecture with Circuit
28mComposing Magic with MVI and Kotlin StateFlow
40mCompose Without Flow: Unidirectional State with Snapshots and Coroutines
28mCompose at Scale: Stop Unnecessary Recomposition
