Skip to content

Commit c300559

Browse files
Deprecate manWithIndex
If we leave mapWithIndex then we should have “withIndex” on many other operators. Instead of this, an Observable should just be zipped with an infinite stream of numbers and the zip function provides the index. This keeps the API surface area smaller and provides the desired behavior on all operators.
1 parent b378593 commit c300559

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3999,6 +3999,7 @@ public <R> Observable<R> map(Func1<? super T, ? extends R> func) {
39993999
* transformed by the given function
40004000
* @see <a href="https://github.com/Netflix/RxJava/wiki/Transforming-Observables#mapwithindex">RxJava Wiki: mapWithIndex()</a>
40014001
* @see <a href="http://msdn.microsoft.com/en-us/library/hh244311.aspx">MSDN: Observable.Select</a>
4002+
* @deprecate just use zip with {@link Observable#range(int)}
40024003
*/
40034004
public <R> Observable<R> mapWithIndex(Func2<? super T, Integer, ? extends R> func) {
40044005
return create(OperationMap.mapWithIndex(this, func));

0 commit comments

Comments
 (0)