Rx\Observable::reduce PHP Method

reduce() public method

The specified seed value is used as the initial accumulator value.
public reduce ( callable $accumulator, mixed $seed = null ) : Rx\Observable\AnonymousObservable
$accumulator callable - An accumulator function to be invoked on each element.
$seed mixed [optional] - The initial accumulator value.
return Rx\Observable\AnonymousObservable - An observable sequence containing a single element with the final accumulator value.
    public function reduce(callable $accumulator, $seed = null)
    {
        return $this->lift(function () use($accumulator, $seed) {
            return new ReduceOperator($accumulator, $seed);
        });
    }