Operations Aggregate, Average and Sum with selector#657
Operations Aggregate, Average and Sum with selector#657benjchristensen merged 1 commit intoReactiveX:masterfrom
Conversation
|
RxJava-pull-requests #590 SUCCESS |
|
This establishes (or strengthens) a precedent of adding a large number of helper methods for very specific cases to the already massive
|
|
I'd go for |
There was a problem hiding this comment.
This is equivalent to:
reduce(seed, accumulator).map(resultSelector)Why the need for a separate operator and implementation?
There was a problem hiding this comment.
I know we can combine ops to get one of the new aggregate variant, but I think it might be worth having a direct version which avoids nesting several layers of Observables, Observers and Subscriptions.
There was a problem hiding this comment.
nesting several layers of Observables, Observers and Subscriptions.
The entire library is based on composition. If we were seeking to avoid that we wouldn't be using a functional style so unless there is a strong performance reason (that isn't a bug with one of the operators themselves) I don't see that as a reason to add a helper operator.
Issue #653
Remarks:
averageIntegerandsumInteger(and the other types) are handy if we want to use chained operation invocations (with less overhead):instead of