I am using RxJava combineLatest method in Kotlin with more than 3 Observables .I am getting error in implementing the method
val userNameObservable = RxHelper.getTextWatcherObservable(username)
val passwordObservable = RxHelper.getTextWatcherObservable(password)
var submitButtonObservable: Observable<String> ?=null
button.setOnClickListener { submitButtonObservable = RxHelper.getButtonClickable() }
observable = Observable.combineLatest(userNameObservable, passwordObservable, submitButtonObservable,Triple(userNameObservable,passwordObservable,submitButtonObservable))
observable?.debounce(800, TimeUnit.MILLISECONDS)?.observeOn(AndroidSchedulers.mainThread())?.subscribe {
if (username.text.isEmpty() || password.text.isEmpty())
button.isEnabled = false
else
button.isEnabled = true
}
}
the error i am getting is:
None of the following functions can be called with the arguments supplied: @CheckReturnValue @SchedulerSupport public final fun combineLatest(p0: ((Observer) -> Unit)!, p1: ((Observer) -> Unit)!, p2: ((Observer) -> Unit)!, p3: ((???, ???, ???) -> Unit)!): Observable! defined in io.reactivex.Observable @CheckReturnValue @SchedulerSupport public open fun combineLatest(p0: ObservableSource!, p1: ObservableSource!, p2: ObservableSource!, p3: io.reactivex.functions.Function3!): Observable! defined in io.reactivex.Observable @CheckReturnValue @SchedulerSupport public open fun combineLatest(p0: Function!, out Unit!>!, p1: Int, vararg p2: ObservableSource!): Observable! defined in io.reactivex.Observable