Abhishek Bansal
02/12/2020, 4:38 PMflowOf(
remoteDataSource.getDataFromCache() // suspending function returning Flow<Data>
.catch { error -> Timber.e(error) },
remoteDataSource.getDataFromServer() // suspending function returning Flow<Data>
).flattenConcat().collect {
Timber.i("Response Received")
}
my expectation here was that I will get first result first and then second after sometime as response comes from server. But the problem here is collect only gets called after server returns result.Abhishek Bansal
02/12/2020, 4:40 PM.flattenMerge()
has same result as welleburke
02/21/2020, 2:26 PM