Daniele B
06/11/2020, 7:56 PMDaniele B
06/11/2020, 8:04 PMVinay Gaba
06/11/2020, 8:07 PMcollectAsState
converts it to a form that compose understands (state
) and is able to listen to the stream seamlessly.Daniele B
06/11/2020, 8:10 PMVinay Gaba
06/11/2020, 8:14 PMDaniele B
06/11/2020, 8:15 PMVinay Gaba
06/11/2020, 8:15 PMDaniele B
06/11/2020, 8:16 PMVinay Gaba
06/11/2020, 9:27 PMDaniele B
06/11/2020, 9:28 PMVinay Gaba
06/11/2020, 9:29 PMDaniele B
06/11/2020, 9:31 PM(x == y)
the do nothing but if (x !=y)
then only emit the new value i.e. y in this case.”Zach Klippenstein (he/him) [MOD]
06/11/2020, 10:12 PMFlow
and StateFlow
is that you can ask a StateFlow
for its current value without collecting it, and it will always immediately emit a value when collected.StateFlow.collectAsState()
doesn’t require you to pass in an initial value, but Flow.collectAsState
does.as far as I understand StateFlow is a hot flow, while Flow is a cold flowNot exactly. A
Flow
can be hot as well, since StateFlow
is a subtype of Flow
. The types don’t necessarily imply anything about their “temperature”.Flow
vs Channel
, where Channel
is always hot.Daniele B
06/11/2020, 10:51 PM