operator may be part of the solution, but it does not cache the latest value, each call to
getLatest()
still triggers a database query
g
gildor
11/26/2019, 12:40 PM
There is no direct Flwo analogue of BehaviorSubject/LiveData. It in development now (there is a PR, search for DataFlow)
But you can use ConflatedBroadcastChannel in coroutines, there is asFlow() extension, so you can expose such channel as Flow
t
tseisel
11/26/2019, 3:55 PM
Good to know ! I'm very enthousiastic about that DataFlow . @gildor Do you know how it behaves in case of an exception in the upstream ?
In my case, the source flow throws a specific exception if some permission is not denied. Will
DataFlow
rethrow that exception or re-collect the upstream ? I'd really like option 2.
g
gildor
11/27/2019, 1:02 AM
But DataFlow or ConflatedBroadcastChannel do not have upstream, that is the whole point