Skip to content

Commit 2a15a62

Browse files
committed
Update 2. Reducing a sequence.md
1 parent 93f5fb5 commit 2a15a62

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Part 2 - Sequence Basics/2. Reducing a sequence.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Most of the operators here will be familiar to anyone who has worked with Java's
66

77
### Marble diagrams
88

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.
1010

1111
![](https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/legend.png)
1212

@@ -111,7 +111,7 @@ Third
111111
Completed
112112
```
113113

114-
"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".
115115

116116
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.
117117

@@ -182,7 +182,7 @@ Completed
182182

183183
## ignoreElements
184184

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`.
186186

187187
```java
188188
Observable<Integer> values = Observable.range(0, 10);
@@ -232,7 +232,7 @@ Subscription first2 = values
232232
Completed
233233
```
234234

235-
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.
236236

237237
`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.
238238

@@ -310,7 +310,7 @@ Completed
310310

311311
## skipWhile and takeWhile
312312

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`
314314

315315
```java
316316
Observable<T> takeWhile(Func1<? super T,java.lang.Boolean> predicate)
@@ -414,7 +414,7 @@ Completed
414414

415415
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.
416416

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.
418418

419419
```java
420420
Observable<Long> values = Observable.interval(100,TimeUnit.MILLISECONDS);

0 commit comments

Comments
 (0)