Skip to content

Commit cdcd75a

Browse files
committed
diagram & description of combineLatest() operator
1 parent abd6685 commit cdcd75a

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

rxjava-core/src/main/java/rx/operators/OperationCombineLatest.java

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,25 @@
4141
import rx.util.functions.FuncN;
4242
import rx.util.functions.Functions;
4343

44+
/**
45+
* Returns an Observable that combines the emissions of multiple source observables. Once each
46+
* source Observable has emitted at least one item, combineLatest emits an item whenever any of
47+
* the source Observables emits an item, by combining the latest emissions from each source
48+
* Observable with a specified function.
49+
* <p>
50+
* <img width="640" src="https://github.com/Netflix/RxJava/wiki/images/rx-operators/combineLatest.png">
51+
*/
4452
public class OperationCombineLatest {
4553

4654
/**
47-
* Combines the two given observables, emitting an event containing an aggregation of the latest values of each of the source observables
48-
* each time an event is received from one of the source observables, where the aggregation is defined by the given function.
49-
* @param w0 The first source observable.
50-
* @param w1 The second source observable.
51-
* @param combineLatestFunction The aggregation function used to combine the source observable values.
52-
* @return A function from an observer to a subscription. This can be used to create an observable from.
55+
* Combines the two given Observables, emitting an item that aggregates the latest values of
56+
* each of the source Observables each time an item is received from either of the source
57+
* Observables, where the aggregation is defined by the given function.
58+
* @param w0 the first source Observable.
59+
* @param w1 the second source Observable.
60+
* @param combineLatestFunction the aggregation function that combines the source Observable
61+
* items.
62+
* @return a function from an Observer to a Subscription. This can be used to create an Observable.
5363
*/
5464
public static <T0, T1, R> Func1<Observer<R>, Subscription> combineLatest(Observable<T0> w0, Observable<T1> w1, Func2<T0, T1, R> combineLatestFunction) {
5565
Aggregator<R> a = new Aggregator<R>(Functions.fromFunc(combineLatestFunction));

0 commit comments

Comments
 (0)