For each, Event
, I want need to send it and validate it. I have this code:
fun process(): Completable =
eventsDao.findAll()
.flatMapCompletable(this::sendEventToServer)
.andThen(this::validate) //Error here
fun send(event: Event): Completable =
//code
fun validate(event: Event): Completable =
//code
Error:(14, 18) None of the following functions can be called with the arguments supplied: @CheckReturnValue @SchedulerSupport public final fun andThen(p0: ((CompletableObserver) -> Unit)!): Completable! defined in io.reactivex.Completable
@CheckReturnValue @SchedulerSupport public final fun andThen(p0: ((MaybeObserver) -> Unit)!): Maybe<(???..???)>! defined in io.reactivex.Completable
@CheckReturnValue @SchedulerSupport public final fun andThen(p0: ((Observer) -> Unit)!): Observable<(???..???)>! defined in io.reactivex.Completable
and so on
Problem is that here:
.andThen(this::validate)
I don't have the event
itself. How can I chain these Completable
s?