Florian
Loading
first
flow { val data = query().first() val flow = if (shouldFetch(data)) { emit(Resource.Loading(data)) try { saveFetchResult(fetch()) onFetchSuccess() query().map { Resource.Success(it) } } catch (t: Throwable) { onFetchFailed(t) query().map { Resource.Error(t, it) } } } else { query().map { Resource.Success(it) } } emitAll(flow) }
Dominaezzz
println
saveFetchResult
A modern programming language that makes developers happier.