How would I write a reactive store / component (i.e something that has its own state, mutator and exposes a observable?) using Flow? In rxjava it would look like this
Copy code
class FooStore {
private val relay = BehaviorRelay.create<State>
val state: Observable<State>
get() = relay
fun mutate(someParams) = relay.accept(relay.value.copy(someParams))
}