Rx\Functional\Operator\ReduceTest::reduce_without_seed_return PHP Method

reduce_without_seed_return() public method

    public function reduce_without_seed_return()
    {
        $xs = $this->createHotObservable([onNext(150, 1), onNext(210, 24), onCompleted(250)]);
        $results = $this->scheduler->startWithCreate(function () use($xs) {
            return $xs->reduce(function ($acc, $x) {
                return $acc + $x;
            });
        });
        $this->assertMessages([onNext(250, 24), onCompleted(250)], $results->getMessages());
    }