0PricingLogin
Kotlin Multiplatform Academy · Lesson

Flow Basics in Shared Code

Emit a stream of values from commonMain.

Streams of Values

A suspend function returns one value, then it is done. A Flow is different: it emits a whole stream of values over time, one after another. 🌊

Cold by Default

A Flow is cold: the code inside it does nothing until someone starts collecting. No collector means no work, which keeps your shared code lazy and cheap.

All lessons in this course

  1. Flow Basics in Shared Code
  2. StateFlow for Shared UI State
  3. Operators: map, filter, combine
  4. Collect Flows on Android & iOS
← Back to Kotlin Multiplatform Academy