React\Promise\RejectedPromise::done PHP Method

done() public method

public done ( callable $onFulfilled = null, callable $onRejected = null )
$onFulfilled callable
$onRejected callable
    public function done(callable $onFulfilled = null, callable $onRejected = null)
    {
        queue()->enqueue(function () use($onRejected) {
            if (null === $onRejected) {
                throw UnhandledRejectionException::resolve($this->reason);
            }
            $result = $onRejected($this->reason);
            if ($result instanceof self) {
                throw UnhandledRejectionException::resolve($result->reason);
            }
            if ($result instanceof ExtendedPromiseInterface) {
                $result->done();
            }
        });
    }