RxJava Return single, execute completable after
Assuming you actually want to return the Single after the Completable, here's another way:
Using Java:
single.flatMap(x -> completable.toSingleDefault(x))
Using Kotlin:
single.flatMap { completable.toSingleDefault(it) }
Use flatMap
:
single.flatMap(v -> completable.andThen(Single.just(v)))