Initial clean up for Combining Observables docs#6135
Initial clean up for Combining Observables docs#6135akarnokd merged 2 commits intoReactiveX:2.xfrom ahmedre:docs_combining_observables
Conversation
|
|
||
| #### combineLatest Example | ||
|
|
||
| ```java |
There was a problem hiding this comment.
i was unsure whether to go with an example like this one or something more abstract but potentially more "useful" like:
Observable<NewsItems> latestNews = getLatestNews();
Observable<Weather> latestWeather = getLatestWeather();
Observable.combineLatest(latestNews, latestWeather, (news, weather) -> Pair(news, weather))
.subscribe(item -> renderUi(item.first, item.second));and am also unsure how you feel about using time operations in examples since you can't just run them and repro the behavior without blocking the thread somehow (TestObserver in unit tests or doing the work on a different thread, etc).
There was a problem hiding this comment.
I prefer examples that can be tried quickly, thus examples requiring custom types are not good.
docs/Combining-Observables.md
Outdated
| #### switchOnNext Example | ||
|
|
||
| ```java | ||
| Observable<Observable<Long>> timeIntervals = Observable.interval(1, TimeUnit.MILLISECONDS) |
There was a problem hiding this comment.
i am not happy with this example - any suggestions?
There was a problem hiding this comment.
Have two intertwined intervals. The outer 1 seconds, the inner 100 milliseconds and the inner could be mapped as outer + "-" + inner so that the switch over to a different value is more clear.
|
|
||
| #### combineLatest Example | ||
|
|
||
| ```java |
There was a problem hiding this comment.
I prefer examples that can be tried quickly, thus examples requiring custom types are not good.
docs/Combining-Observables.md
Outdated
| #### switchOnNext Example | ||
|
|
||
| ```java | ||
| Observable<Observable<Long>> timeIntervals = Observable.interval(1, TimeUnit.MILLISECONDS) |
There was a problem hiding this comment.
Have two intertwined intervals. The outer 1 seconds, the inner 100 milliseconds and the inner could be mapped as outer + "-" + inner so that the switch over to a different value is more clear.
docs/Combining-Observables.md
Outdated
|
|
||
| ## startWith | ||
|
|
||
| Emit a specified sequence of items before beginning to emit the items from the Observable. |
There was a problem hiding this comment.
These descriptions are after Available and ReactiveX notes in #6131 btw.
|
Thanks for your contribution and keep up the good work! 👍 I'll merge this once the Travis CI service works properly again. |
Codecov Report
@@ Coverage Diff @@
## 2.x #6135 +/- ##
============================================
- Coverage 98.31% 98.28% -0.04%
- Complexity 6192 6197 +5
============================================
Files 667 667
Lines 44853 44853
Branches 6213 6213
============================================
- Hits 44097 44082 -15
- Misses 228 232 +4
- Partials 528 539 +11
Continue to review full report at Codecov.
|
This patch updates the style of the combining observables documentation to be similar to that of #6131 and adds examples for most of the operators therein. Refs #6132.
What's left for combining observables:
join,groupJoin, andrxjava-joinsconcat,concatEager, andwithLatestFrom