I am using the RXKotlin combineLatest and I have a multiple source. but I am calling this like
Observables.combineLatest(source1, source2)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(
{
val first = it.first
val second = it.second
},
{
}
)
and
Observables.combineLatest(source3, source4)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(
{
val first = it.first
val second = it.second
},
{
}
)
now I just want to ask on how to use the combineLatest to my sources only once.
like this.
Observables.combineLatest(source1, source2, source3, source4)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(
{
val first = it.first
val second = it.second
val third = it.third
val fourth = it.fourth
//...
},
{
}
)
I am always using this combineLatest but only with three parameters and I really don't know how or what should I do when I add more parameters to it.
Any help is appreciated, Thank you.