Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumKotlinStateFlow SharedFlowSingle-choice MCQ

A StateFlow holds a data class value. Code sets stateFlow.value to a new instance that is structurally equal (==) to the current one. What happens to collectors?

data class P(val n: Int) val s = MutableStateFlow(P(1)) // later: s.value = P(1)