Automattic\WooCommerce\Vendor\GraphQL\Executor\Promise\Adapter

ReactPromiseAdapter::thenpublicWC 1.0

Method of the class: ReactPromiseAdapter{}

No Hooks.

Returns

null. Nothing (null).

Usage

$ReactPromiseAdapter = new ReactPromiseAdapter();
$ReactPromiseAdapter->then( $promise, ?callable $onFulfilled, ?callable $onRejected ): Promise;
$promise(Promise) (required)
.
?callable $onFulfilled
.
Default: null
?callable $onRejected
.
Default: null

ReactPromiseAdapter::then() code WC 10.9.4

public function then(Promise $promise, ?callable $onFulfilled = null, ?callable $onRejected = null): Promise
{
    $reactPromise = $promise->adoptedPromise;
    assert($reactPromise instanceof ReactPromiseInterface);

    return new Promise($reactPromise->then($onFulfilled, $onRejected), $this);
}