ghedeon
01/13/2019, 7:24 PMNetworkBoundResource
from Google's app guide: https://developer.android.com/jetpack/docs/guide#addendum. How do you replicate similar functionality in coroutines world? Can you reuse it? Do you apply some completely different technic?
Some thoughts:
Case 1: network request, no caching required:
Before: return LiveData<Resutl>()
After: probably just suspended get(): Result
? Seems enough. Error/Success
, no need for a stream here.
Case 2: network request, return cache first, update cache, return fresh data
Before: return NetworkBoundResource
as LiveData (emits two items, cached and refreshed)
After? Channels? Actors?
(P.S. Does anybody have an example of cache aware Repository with coroutines? )Dico
01/13/2019, 9:07 PMgildor
01/14/2019, 8:02 AMradityagumay
01/14/2019, 2:11 PMghedeon
01/14/2019, 4:13 PMFlowable
. Still no channels..Dico
01/14/2019, 4:29 PM