A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/ReactiveX/RxJava/issues/6634 below:

improve combineLatest method names · Issue #6634 · ReactiveX/RxJava · GitHub

Calling combineLatest from Kotlin is a bit awkward. The function has a lot of different parameters, including Iterable, Array as well as 2-x call sites for passing multiple Observables.

Is it possible to prefix these so we have some kind of combineLatestFromIterable which takes the Iterable<T>:

-public static <T, R> Observable<R> combineLatest(Iterable<? extends ObservableSource<? extends T>> sources, Function<? super Object[], ? extends R> combiner) {
+public static <T, R> Observable<R> combineLatestFromIterable(Iterable<? extends ObservableSource<? extends T>> sources, Function<? super Object[], ? extends R> combiner) {

and then combineLatest which takes the 2-x call sites.

public static <T1, T2, R> Observable<R> combineLatest(
            ObservableSource<? extends T1> source1, ObservableSource<? extends T2> source2,
            BiFunction<? super T1, ? super T2, ? extends R> combiner) {

The array call we could call combineLatestFromArray.

-public static <T, R> Observable<R> combineLatest(ObservableSource<? extends T>[] sources, Function<? super Object[], ? extends R> combiner) {
+public static <T, R> Observable<R> combineLatestFromArray(ObservableSource<? extends T>[] sources, Function<? super Object[], ? extends R> combiner) {

What should we do with?

public static <T, R> Observable<R> combineLatest(Function<? super Object[], ? extends R> combiner, int bufferSize, ObservableSource<? extends T>... sources) {

Is it really required? Callers could just use the array overload.

combineLatestDelayError is equivalent and could get the method name improvements as well.

Other methods, such as concat/merge could benefit from this change too.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4