I'm using the io.reactivex.rxkotlin
extension function:
fun <T : Any> Observable<T>.subscribeBy(
onError: (Throwable) -> Unit = onErrorStub,
onComplete: () -> Unit = onCompleteStub,
onNext: (T) -> Unit = onNextStub
): Disposable
And when I use this extension there is a difference if I choose to send a parameter or if I use lambda. For example
first implementation:
myObservable.subscribeBy { str ->
// onNext
}
Second implementation:
myObservable.subscribeBy({ throwable ->
// onError
})
- in the first implementation the function is the
onNext
- and in the second implementation the function is the
onError
And I'm not sure why.