RxJava 2
I have the following 2 examples of how a skipUntil is used:
This one passes a lambda function to the skipUntil:
sourceSubject
.skipUntil<Int> {
triggerSubject.subscribe(it)
}
.subscribeBy { println(it) }
And this one passes the observer:
sourceSubject
.skipUntil(triggerSubject)
.subscribeBy { println(it) }
However, I am confused with the method signature as it only seems to take a Observer and I couldn't see the lambda. Just wondering why I can pass a observer and pass a lambda to this function
Here is the method that just seems to show passing in an Observer:
public final <U> Observable<T> skipUntil(ObservableSource<U> other) {
ObjectHelper.requireNonNull(other, "other is null");
return RxJavaPlugins.onAssembly(new ObservableSkipUntil<T, U>(this, other));
}
Many thanks in advance