0Pricing
Kotlin Multiplatform Academy · Lesson

Expose Results as Flow

Stream repository data to both UIs reactively.

Beyond One-Shot Calls

A suspend function returns once, but real screens want updates over time. That is exactly what Flow gives you.

Return a Flow

Change the repository to return a Flow of your domain type, so callers can react to a stream of results.

fun observeUsers(): Flow<List<User>>

All lessons in this course

  1. Define a Repository Interface
  2. Wrap the API Behind the Repository
  3. Map DTOs to Domain Models
  4. Expose Results as Flow
← Back to Kotlin Multiplatform Academy