Joey
03/03/2026, 8:02 AMval aFlow = emptyFlow<String?>()
val delegationValue by aFlow.collectAsState(initial = null)
val directValue = aFlow.collectAsState(initial = null).value
Is there a difference in these 2 setups outside the fact that the second option doesn't require enforcing non-nullability using !! as smart casting works properly due to not being delegated? Or will there be performance tradeoffs and/or behavioral differences as well?Jonas Pedersen
03/03/2026, 10:47 AMdirectValue would trigger recomposition in the same scope that you do collectAsState instead of the scope where you would use delegationValue.Joey
03/03/2026, 2:05 PMJoey
03/04/2026, 12:04 PM