Mikael Alfredsson12/09/2021, 7:26 AM
parameter so that I can query the parameter at any point in time? (sort of a stateful share flow 🙂 )
elizarov12/09/2021, 7:37 AM
(not a data class) and every time you emit a Box to a state flow it will be treated like a new value.
class Box<T>(val value: T)
Mikael Alfredsson12/09/2021, 7:39 AM
not the nicest solution, even if it works.
elizarov12/09/2021, 8:09 AM
anywhere in the codebase I know exactly how it is going to behave without hunting down the place where it is created.
Mikael Alfredsson12/09/2021, 8:21 AM
Nick Allen12/09/2021, 6:07 PM
when replay is 1 not work for some reason?
Mikael Alfredsson12/09/2021, 7:38 PM
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
parameter, or a StateFlow that emits every value independent on the result of the