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

reduce_with_seed_empty() public method

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