napi_resolve_deferred

Function napi_resolve_deferred 

Source
pub unsafe extern "C" fn napi_resolve_deferred(
    env: napi_env,
    deferred: napi_deferred,
    resolution: napi_value,
) -> napi_status
Available on crate feature napi only.
Expand description

Resolves a promise by way of the deferred object associated.

§Arguments

  • env - Current running virtual machine context.

  • deferred - The deferred object which is utilized to resolve the promise.

  • resolution - The resolution value used to resolve the promise.

§Returns

  • Returns the function execution status. [napi_ok] If the function executed successfully.

[napi_invalid_arg] If env, deferred or resolution is nullptr.

[napi_pending_exception] If an ArkTS exception existed when the function was called.

Available since API-level: 10