RxJava - use variables of a different types (results of a multiple chain operators) within "subscribe" lambda
I'm trying to rewrite following rx-code in such way to remove a subscription within another subscription and to make code look more idiomatic:
private fun foo() {
compositeDisposable.add(getApiDataObservable().subscribe({ result ->
if (!result.isSuccess) {
mutableLiveData.value = "errorMessage"
} else {
compositeDisposable.add(Observable.zip(firstObservable,
secondObservable,...