like retrofit can use merge Operator Make multiple requests
Retrofit can actually not merge requests by itself. When using an extension, such as RxJava with retrofit, "merging" requests is done with that.
https://developer.android.com/reference/android/arch/lifecycle/MediatorLiveData
You can use a MediatorLiveData and two Fuel to livedata calls to get a live data that responds when both are done.
You can use the same interface as in Retrofit to merge two Fuel to Observable calls.
You can make a new suspending function that awaits two things:
fun suspend both(){
...deferredCallOne
...deferredCallTwo
val resultOne = deferredOne.await()
val resultTwo = deferredTwo.await()
return ...
}
I welcome someone to actually write these out as examples, but "merging two requests", outside the scope of HTTP/2 is not in the scope of Fuel.
Most helpful comment
Retrofit can actually not merge requests by itself. When using an extension, such as
RxJavawith retrofit, "merging" requests is done with that.LiveData
https://developer.android.com/reference/android/arch/lifecycle/MediatorLiveData
You can use a
MediatorLiveDataand twoFuelto livedata calls to get a live data that responds when both are done.RxJava
You can use the same interface as in Retrofit to merge two
FueltoObservablecalls.Coroutines
You can make a new suspending function that awaits two things:
I welcome someone to actually write these out as examples, but "merging two requests", outside the scope of HTTP/2 is not in the scope of
Fuel.