Skip to content

Commit a74c412

Browse files
committed
Update 4. Combining sequences.md
1 parent 753d121 commit a74c412

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Part 3 - Taming the sequence/4. Combining sequences.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Combining sequences
22

3-
So far, we've seen most of the methods that allow us to create a sequence and transform it into what we want. However, most applications will have more than one sources of input. We need a way a of combining sequences. We've already seen a few sequences that use more than one observable. In this chapter, we will see the most important operators that use multiple sequences to produce one.
3+
So far, we've seen most of the methods that allow us to create a sequence and transform it into what we want. However, most applications will have more than one source of input. We need a way a of combining sequences. We've already seen a few sequences that use more than one observable. In this chapter, we will see the most important operators that use multiple sequences to produce one.
44

55
## Concatenation
66

@@ -27,7 +27,7 @@ public static final <T> Observable<T> concat(Observable<? extends T> t1,
2727
```
2828
![](https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/concat.png)
2929

30-
Concatenating two (or more) given observables is very straight forward.
30+
Concatenating two (or more) given observables is straightforward.
3131

3232
```java
3333
Observable<Integer> seq1 = Observable.range(0, 3);
@@ -46,7 +46,7 @@ Observable.concat(seq1, seq2)
4646
12
4747
```
4848

49-
If the number of sequences to be combined is dynamic, you can provide an observable that emits the sequences to be concatenated. In this example, we will use our familiar `groupBy` to create a sequence that emits words that start with the same letter together.
49+
If the number of sequences to be combined is dynamic, you can provide an observable that emits the sequences to be concatenated. In this example, we will use our familiar `groupBy` to create a sequence that emits words starting with the same letter together.
5050

5151
```java
5252
Observable<String> words = Observable.just(
@@ -106,7 +106,7 @@ public final Observable<T> repeat()
106106
public final Observable<T> repeat(long count)
107107
```
108108

109-
It application is very simple
109+
Its application is very simple
110110

111111
```java
112112
Observable<Integer> words = Observable.range(0,2);
@@ -320,7 +320,7 @@ Second
320320
First
321321
```
322322

323-
The difference between `concat` and `merge` is that `merge` does not wait for the current observable to terminate before moving to the next. `merge` subscribes to every observable available to it and emits items as they come. It that way, `merge` is similar to the flattening part of `flatMap`.
323+
The difference between `concat` and `merge` is that `merge` does not wait for the current observable to terminate before moving to the next. `merge` subscribes to every observable available to it and emits items as they come. In that way, `merge` is similar to the flattening part of `flatMap`.
324324

325325
Like other combinators that are static methods, `merge` has an alternative that allows you to merge sequences one by one in a chain. The operator is called `mergeWith` and the behaviour is the same. The following example has the same result as the one above.
326326

@@ -444,7 +444,7 @@ Observable.switchOnNext(
444444
2
445445
```
446446

447-
This example may be a bit confusing. What we've done is create an observable that creates a new observable every 100ms. Every created observable emits it's number in the sequence every 30ms. After 100ms, each of those observables has had enough time to emit its number 3 times. Then a new observable is created, which causes them to be replaced by the new one.
447+
This example may be a bit confusing. What we've done is creating an observable that creates a new observable every 100ms. Every created observable emits its number in the sequence every 30ms. After 100ms, each of those observables has had enough time to emit its number 3 times. Then a new observable is created, which causes them to be replaced by the new one.
448448

449449
#### switchMap
450450

@@ -661,7 +661,7 @@ Right emits
661661
3 - 2
662662
```
663663

664-
As we can see, ``combineLatest` first it waits for every sequence to have a value. After that, every value emitted by either observable results in a combined value being emitted.
664+
As we can see, `combineLatest` first it waits for every sequence to have a value. After that, every value emitted by either observable results in a combined value being emitted.
665665

666666
Just like every combinator we've seen in this chapter, there are overloads that allow to combine more than two sequences.
667667

0 commit comments

Comments
 (0)