Fix javadoc for Observable.reduce() and Observable.reduceWith()#5406
Fix javadoc for Observable.reduce() and Observable.reduceWith()#5406akarnokd merged 8 commits intoReactiveX:2.xfrom
Conversation
|
Could you also fix Flowable's javadoc? |
|
@akarnokd Done. |
|
The |
akarnokd
left a comment
There was a problem hiding this comment.
A small original mention of Publisher could be fixed.
| * source.compose(o -> | ||
| * Publisher.defer(() -> o.reduce(new ArrayList<>(), (list, item) -> list.add(item))) | ||
| * ); | ||
| * Publisher.defer(() -> o.reduce(new ArrayList<>(), (list, item) -> list.add(item)).toFlowable()) |
There was a problem hiding this comment.
This should be Flowable.defer.
|
Updated according to the feedback. |
|
Great! |
Codecov Report
@@ Coverage Diff @@
## 2.x #5406 +/- ##
======================================
Coverage ? 96.19%
Complexity ? 5789
======================================
Files ? 630
Lines ? 41197
Branches ? 5728
======================================
Hits ? 39629
Misses ? 605
Partials ? 963
Continue to review full report at Codecov.
|
The sample code given in the javadoc for
Observable.reduce()isn't compiling, since the function returns aSingle.This PR changes it to a compiling example.
It also updates the javadoc for
reduceWith()to better match its actual behaviour.Remark
I'm not sure whether the sample code for
reduce()is needed at all. The problem that it addresses might be solved better by usingreduceWith(), imho.Update
Flowable.reduce()andFlowable.reduceWith()