Skip to content

Commit f3734bf

Browse files
remove takeWhileWithIndex
1 parent 01f5464 commit f3734bf

File tree

2 files changed

+5
-17
lines changed

2 files changed

+5
-17
lines changed

language-adaptors/rxjava-scala/src/examples/scala/rx/lang/scala/examples/RxScalaDemo.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,11 @@ class RxScalaDemo extends JUnitSuite {
454454
Thread.sleep(1500) // or convert to BlockingObservable
455455
}
456456

457+
@Test def takeWhileWithIndexAlternative {
458+
val condition = true
459+
Observable("a", "b").zipWithIndex.takeWhile{case (elem, index) => condition}.map(_._1)
460+
}
461+
457462
def output(s: String): Unit = println(s)
458463

459464
// blocks until obs has completed

language-adaptors/rxjava-scala/src/main/scala/rx/lang/scala/Observable.scala

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1185,23 +1185,6 @@ class Observable[+T] private[scala] (val asJava: rx.Observable[_ <: T])
11851185
def takeWhile(predicate: T => Boolean): Observable[T] = {
11861186
Observable[T](asJava.takeWhile(predicate))
11871187
}
1188-
1189-
/**
1190-
* Returns an Observable that emits the items emitted by a source Observable so long as a given
1191-
* predicate remains true, where the predicate can operate on both the item and its index
1192-
* relative to the complete sequence.
1193-
*
1194-
* <img width="640" src="https://github.com/Netflix/RxJava/wiki/images/rx-operators/takeWhileWithIndex.png">
1195-
*
1196-
* @param predicate
1197-
* a function to test each item emitted by the source Observable for a condition;
1198-
* the second parameter of the function represents the index of the source item
1199-
* @return an Observable that emits items from the source Observable so long as the predicate
1200-
* continues to return `true` for each item, then completes
1201-
*/
1202-
def takeWhileWithIndex(predicate: (T, Integer) => Boolean): Observable[T] = {
1203-
Observable[T](asJava.takeWhileWithIndex(predicate))
1204-
}
12051188

12061189
/**
12071190
* Returns an Observable that emits only the last `count` items emitted by the source

0 commit comments

Comments
 (0)