https://kotlinlang.org logo
Title
k

kevin.cianfarini

05/14/2020, 6:57 PM
is StateFlow sticky? Do new consumers who call collect receive the latest stored value?
:yes: 1
l

louiscad

05/14/2020, 7:24 PM
@kevin.cianfarini Yes. Isn't it mentioned in the documentation?
k

kevin.cianfarini

05/14/2020, 7:27 PM
nothing is quite jumping out at me explicitly stating so. In fact this piece from the docs makes me think the opposite.
The flow of future updates to the value can be observed by collecting values from this flow.
specifically calling out future values
l

louiscad

05/14/2020, 7:31 PM
A
StateFlow
keeps its last value, and collectors always get the latest value.
k

kevin.cianfarini

05/14/2020, 7:31 PM
awesome
u

ursus

05/18/2020, 7:46 AM
Is there a publish relay analog?