Hello everyone, I've posted a question on stackove...
# rx
Hello everyone, I've posted a question on stackoverflow around Flowable, Rx, Kotlin, Retrofit2. Thanks to take a look if you can ­čĹŹ https://stackoverflow.com/questions/45441074/multiple-retrofit2-requests-using-flowable-in-kotlin 1 reply this is how i would solve it:
Copy code
Flowable.zip<User, Comments, Pair<User, Comments>>(
      BiFunction { user, comments -> Pair(user, comments) })
      .map { (first, second) -> Triple(first, second, ExtraDatas()) }
        Log.d("MainActivity", "OnNext")
      }, {
        Log.d("MainActivity", "OnError")
      }, {
        Log.d("MainActivity", "OnComplete")
Use the
functions to achieve your goal if the retrofit2 calls dont depent on each other. You can find out more here: http://reactivex.io/documentation/operators/zip.html after that map the data from the server with the mainActivity data together. Thats easy as well and finally Kotlin has a very beautiful syntax for labdas so i would encourage you to use them with the specific subscribe function: http://reactivex.io/RxJava/javadoc/io/reactivex/Flowable.html#subscribe(io.reactivex.functions.Consumer,%20io.reactivex.functions.Consumer,%20io.reactivex.functions.Action)