Mikael Alfredsson
12/09/2021, 7:26 AM.value
parameter so that I can query the parameter at any point in time? (sort of a stateful share flow 🙂 )elizarov
12/09/2021, 7:37 AMclass Box<T>(val value: T)
(not a data class) and every time you emit a Box to a state flow it will be treated like a new value.Mikael Alfredsson
12/09/2021, 7:39 AMMikael Alfredsson
12/09/2021, 7:41 AMstateflow.value.value
not the nicest solution, even if it works.elizarov
12/09/2021, 8:09 AMStateFlow<SomeType>
anywhere in the codebase I know exactly how it is going to behave without hunting down the place where it is created.elizarov
12/09/2021, 8:10 AMMikael Alfredsson
12/09/2021, 8:21 AMNick Allen
12/09/2021, 6:07 PMSharedFlow.replayCache
when replay is 1 not work for some reason?Mikael Alfredsson
12/09/2021, 7:38 PMdistinctUntilChanged
on a sharedFlow.
another consumer wants to know if the value is “fresh”, i.e for each consumed value I update a timer, and if the timer runs out I know that the value is old, and might have to trigger a warning to the user.
In a third place I just want to know the current state in an If statement
I know that we can create this with a number of different workarounds, so it’s not really hindering me that much, but for me, the perfect Flow for this combination of consumers would either be a SharedFlow with a value
parameter, or a StateFlow that emits every value independent on the result of the equals
method.