You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Part 2 - Sequence Basics/2. Reducing a sequence.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ Most of the operators here will be familiar to anyone who has worked with Java's
6
6
7
7
### Marble diagrams
8
8
9
-
This is an appropriate time to introduce to concept of marble diagrams. It is a popular way of explaining the operators in Rx, because of their intuitive and graphical nature. They are present a lot in the documetation of RxJava and it only makes sense that we take advantage of their explanatory nature. The format is mostly self-explanatory: time flows left to right, shapes represent values, a slash is a onCompletion, an X is an error. The operator is applied to the top sequence and the result is the sequence below.
9
+
This is an appropriate time to introduce to concept of marble diagrams. It is a popular way of explaining the operators in Rx, because of their intuitive and graphical nature. They are present a lot in the documentation of RxJava and it only makes sense that we take advantage of their explanatory nature. The format is mostly self-explanatory: time flows left to right, shapes represent values, a slash is a onCompletion, an X is an error. The operator is applied to the top sequence and the result is the sequence below.
"Fourth" and "Fifth" were filtered out because their is is 'F' and that has already appeared in "First".
114
+
"Fourth" and "Fifth" were filtered out because their first character is 'F' and that has already appeared in "First".
115
115
116
116
An experienced programmer already knows that this operator maintains a set internally with every unique value that passes through the observable and checks every new value against it. While Rx operators neatly hide these things, you should still be aware that an Rx operator can have a significant cost and consider what you are using it on.
117
117
@@ -182,7 +182,7 @@ Completed
182
182
183
183
## ignoreElements
184
184
185
-
`ignoreElements` will ignore every value, but lets though`onCompleted` and `onError`.
185
+
`ignoreElements` will ignore every value, but lets pass through`onCompleted` and `onError`.
Users of Java 8 streams will be know the `take` operator as `limit`. The `limit` operator exists in Rx too, for symmetry purposes. It is an alias of `take`, but it lacks the richer overloads that we will soon see.
235
+
Users of Java 8 streams should know the `take` operator as `limit`. The `limit` operator exists in Rx too, for symmetry purposes. It is an alias of `take`, but it lacks the richer overloads that we will soon see.
236
236
237
237
`take` completes as soon as the n-th item is available. If an error occurs, the error will be forwarded, but not if it occurs after the cutting point. `take` doesn't care what happens in the observable after the n-th item.
238
238
@@ -310,7 +310,7 @@ Completed
310
310
311
311
## skipWhile and takeWhile
312
312
313
-
`take` and `skip` work with predefined indices. If you want to "discover" the cutoff point as the values come, `takeWhile` and `shipWhile` will use a predicate instead. `takeWhile` takes items while a predicate function returns `true`
313
+
`take` and `skip` work with predefined indices. If you want to "discover" the cutoff point as the values come, `takeWhile` and `skipWhile` will use a predicate instead. `takeWhile` takes items while a predicate function returns `true`
314
314
315
315
```java
316
316
Observable<T> takeWhile(Func1<? super T,java.lang.Boolean> predicate)
@@ -414,7 +414,7 @@ Completed
414
414
415
415
As you may remember, `timer` here will wait 250ms and emit one event. This signals `takeUntil` to stop the sequence. Note that the signal can be of any type, since the actual value is not used.
416
416
417
-
Once again `skipUntil` works by the same rules and returns the other half of the observable. Values are ignored until the signal comes to start letting values through.
417
+
Once again `skipUntil` works by the same rules and returns the other half of the observable. Values are ignored until the signal comes to start letting values pass through.
0 commit comments