StateFlow, SharedFlow & stateIn
Cold flows re-run for every collector
A plain Flow (Module 7's repo.fetchWalkers() world, but imagine it returning a Flow<List<Walker>> instead of a one-shot List<Walker>) is cold: nothing happens until something collects it, and the whole producer block runs again, from scratch, for each new collector. Two screens collecting the same repository Flow means two separate network calls, two separate DB queries β whatever the producer does, it does it twice.
That's rarely what a ViewModel wants to expose. StateFlow is different: it's hot and stateful β it always holds exactly one current value (.value), new collectors get that value immediately instead of triggering a fresh run, and every collector shares the same underlying work. It's the same private-MutableStateFlow-public-StateFlow shape you've used since Module 6, just now built from an upstream Flow instead of assigned to directly.