ReactiveX / RxSwift

Reactive Programming in Swift
MIT License
24.32k stars 4.17k forks source link

introduce reduce with inout accumulator parameter #2611

Open kjaklinovic opened 2 months ago

kjaklinovic commented 2 months ago

The scan function has a variant in which it takes an input parameter as the first accumulator argument. I find that function more convenient since it requires a bit less code for the accumulator. I noticed that the same is not true for reduce, so I decided to introduce this behavior. I pretty much followed the same code style as scan has. I did the same for tests too, for every ~second existing test for reduce I introduced the new variant of the operator.