The state of managing state (with Compose)
Article Summary
Cash App's Jake Wharton just open-sourced their solution to a problem every mobile team faces: state management code that's impossible to read.
After five years of iterating through RxJava and Kotlin Flow, Wharton realized the problem wasn't the streaming library. It was how state logic itself gets written. His answer? Molecule, a library that uses Compose for state production, not just UI rendering.
Key Takeaways
- Business logic was drowning in RxJava operator chains and nesting
- Molecule lets composable functions return state values as StateFlow
- Write plain conditionals and loops instead of complex operator combinations
- Compose compiler enables readable state logic with remember and effects
- Released publicly after five months of internal testing at Cash App
Critical Insight
Molecule separates Compose's state management superpowers from UI rendering, making business logic dramatically more readable.