~/talk

Molecule: Using Compose for Presentation Logic

Talkat DroidKaigi 2022 · 2022-10-05..10-07· [android, frontend-architecture]
links:none on file
slides:none on file

Molecule turns Compose’s compiler plugin into a presenter builder so presentation logic runs as Compose code but without Compose UI dependencies. It exposes launchMolecule API returning a StateFlow, uses Compose primitives like mutableStateOf, remember and launchedEffect to cancel/restart work, and requires a recomposition clock (choose recomposition clock: context or immediate). Tests run with CashApp’s Turbine and immediate clock. Key behaviors: combines streams with ordinary Kotlin control flow and yields one emission per frame, matching the Android UI dispatcher.

AI-written summary · about

  1. 0:00Molecule and Compose intro
  2. 2:25What Molecule lets us write
  3. 3:52Reactive programming on Android
  4. 9:35Flow and suspend limits
  5. 10:38Compose for presentation logic
  6. 15:53Why Molecule is needed
  7. 16:58Using Molecule in projects
  8. 19:54Recomposition clocks
  9. 21:40Building a search screen
  10. 23:24Testing Molecule presenters
  11. 24:25Key takeaways
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.