我想在一个对象中结合2个单曲的响应
override fun buildUseCase(params: Int): Single<EventDetails> {
return eventDetailsComponent.getEventDetails(params)
.zipWith(bookingComponent.getBookingPage(bookingParams), BiFunction { details, page ->
return@BiFunction details.apply { booking_page = page } })
}
但是当我订阅时我没有收到onSuccess,因为其中一个单曲在另一个之前完成
fun loadEventDetails(id: Int) {
usecase.execute(id)
.doOnSubscribe(onSubscribe)
.observeOn(SchedulerProvider.mainThread)
.subscribeBy(onSuccess = { details -> setValues(details) },onError = onError)
.addTo(subscriptions)
}
如何合并这些来电?或者到底收到onSuccess?
答案 0 :(得分:0)
显然我忘记了XPathExpression.evalute(Object item)
主线程