diff --git a/akka-docs/src/main/paradox/stream/operators/Source-or-Flow/takeWhile.md b/akka-docs/src/main/paradox/stream/operators/Source-or-Flow/takeWhile.md index 2e72033b4c..8cdf517409 100644 --- a/akka-docs/src/main/paradox/stream/operators/Source-or-Flow/takeWhile.md +++ b/akka-docs/src/main/paradox/stream/operators/Source-or-Flow/takeWhile.md @@ -1,6 +1,6 @@ # takeWhile -Pass elements downstream as long as a predicate function return true for the element include the element when the predicate first return false and then complete. +Pass elements downstream as long as a predicate function returns true and then complete. @ref[Simple operators](../index.md#simple-operators) @@ -14,8 +14,8 @@ Pass elements downstream as long as a predicate function return true for the ele ## Description -Pass elements downstream as long as a predicate function return true for the element include the element -when the predicate first return false and then complete. +Pass elements downstream as long as a predicate function returns true and then complete. +The element for which the predicate returns false is not emitted. ## Example @@ -36,4 +36,3 @@ Java **completes** when predicate returned false or upstream completes @@@ - diff --git a/akka-docs/src/main/paradox/stream/operators/index.md b/akka-docs/src/main/paradox/stream/operators/index.md index 046452d28c..e1455e551b 100644 --- a/akka-docs/src/main/paradox/stream/operators/index.md +++ b/akka-docs/src/main/paradox/stream/operators/index.md @@ -178,7 +178,7 @@ depending on being backpressured by downstream or not. |Source/Flow|@ref[sliding](Source-or-Flow/sliding.md)|Provide a sliding window over the incoming stream and pass the windows as groups of elements downstream.| |Source/Flow|@ref[statefulMapConcat](Source-or-Flow/statefulMapConcat.md)|Transform each element into zero or more elements that are individually passed downstream.| |Source/Flow|@ref[take](Source-or-Flow/take.md)|Pass `n` incoming elements downstream and then complete| -|Source/Flow|@ref[takeWhile](Source-or-Flow/takeWhile.md)|Pass elements downstream as long as a predicate function return true for the element include the element when the predicate first return false and then complete.| +|Source/Flow|@ref[takeWhile](Source-or-Flow/takeWhile.md)|Pass elements downstream as long as a predicate function returns true and then complete. | |Source/Flow|@ref[throttle](Source-or-Flow/throttle.md)|Limit the throughput to a specific number of elements per time unit, or a specific total cost per time unit, where a function has to be provided to calculate the individual cost of each element.| |Source/Flow|@ref[watch](Source-or-Flow/watch.md)|Watch a specific `ActorRef` and signal a failure downstream once the actor terminates.| diff --git a/akka-docs/src/test/scala/docs/stream/operators/sourceorflow/TakeWhile.scala b/akka-docs/src/test/scala/docs/stream/operators/sourceorflow/TakeWhile.scala index 2bf0569ab5..c2ad81527f 100644 --- a/akka-docs/src/test/scala/docs/stream/operators/sourceorflow/TakeWhile.scala +++ b/akka-docs/src/test/scala/docs/stream/operators/sourceorflow/TakeWhile.scala @@ -13,6 +13,7 @@ object TakeWhile { // #take-while Source(1 to 10).takeWhile(_ < 3).runForeach(println) + // prints // 1 // 2 // #take-while