Level 1 · Apprentice0 XP
A stream of values over time, built on coroutines.
Step 1 / 5
ProblemA suspend function returns once. But the screen must follow a search box as the user types, a download as it progresses, a database table as it changes. Callbacks for each update bring back the nesting coroutines removed.
← → step
Before this: Coroutines: structured concurrency
🛠️ Your turn
Reading is not the skill, doing is. Try for ten minutes before you open the hint. Getting stuck first is what makes the solution stick.
1.Write a flow that emits 1 to 5 with a 100 ms delay, and collect it twice to see it run twice. Then build a countdown as a StateFlow in a class, and a search flow with debounce and flatMapLatest against a fake suspend search function. Test it with runTest.