Skip to content

Commit c277fb3

Browse files
zip(Iterable) -> zipWith(Iterable)
As per ReactiveX#1578
1 parent b0c98a5 commit c277fb3

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

rxjava-core/src/main/java/rx/Observable.java

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9924,10 +9924,43 @@ public final <U> Observable<Observable<T>> window(Observable<U> boundary) {
99249924
* sequence and emits the results of {@code zipFunction} applied to these pairs
99259925
* @see <a href="https://github.com/Netflix/RxJava/wiki/Combining-Observables#zip">RxJava wiki: zip</a>
99269926
* @see <a href="http://msdn.microsoft.com/en-us/library/system.reactive.linq.observable.zip.aspx">MSDN: Observable.Zip</a>
9927+
* @deprecated use zipWith
99279928
*/
9929+
@Deprecated
99289930
public final <T2, R> Observable<R> zip(Iterable<? extends T2> other, Func2<? super T, ? super T2, ? extends R> zipFunction) {
99299931
return lift(new OperatorZipIterable<T, T2, R>(other, zipFunction));
99309932
}
9933+
9934+
/**
9935+
* Returns an Observable that emits items that are the result of applying a specified function to pairs of
9936+
* values, one each from the source Observable and a specified Iterable sequence.
9937+
* <p>
9938+
* <img width="640" height="380" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/zip.i.png" alt="">
9939+
* <p>
9940+
* Note that the {@code other} Iterable is evaluated as items are observed from the source Observable; it is
9941+
* not pre-consumed. This allows you to zip infinite streams on either side.
9942+
* <dl>
9943+
* <dt><b>Scheduler:</b></dt>
9944+
* <dd>{@code zip} does not operate by default on a particular {@link Scheduler}.</dd>
9945+
* </dl>
9946+
*
9947+
* @param <T2>
9948+
* the type of items in the {@code other} Iterable
9949+
* @param <R>
9950+
* the type of items emitted by the resulting Observable
9951+
* @param other
9952+
* the Iterable sequence
9953+
* @param zipFunction
9954+
* a function that combines the pairs of items from the Observable and the Iterable to generate
9955+
* the items to be emitted by the resulting Observable
9956+
* @return an Observable that pairs up values from the source Observable and the {@code other} Iterable
9957+
* sequence and emits the results of {@code zipFunction} applied to these pairs
9958+
* @see <a href="https://github.com/Netflix/RxJava/wiki/Combining-Observables#zip">RxJava wiki: zip</a>
9959+
* @see <a href="http://msdn.microsoft.com/en-us/library/system.reactive.linq.observable.zip.aspx">MSDN: Observable.Zip</a>
9960+
*/
9961+
public final <T2, R> Observable<R> zipWith(Iterable<? extends T2> other, Func2<? super T, ? super T2, ? extends R> zipFunction) {
9962+
return lift(new OperatorZipIterable<T, T2, R>(other, zipFunction));
9963+
}
99319964

99329965
/**
99339966
* Returns an Observable that emits items that are the result of applying a specified function to pairs of

0 commit comments

Comments
 (0)