Lines Matching refs:promise

9 …** by **reject()**. Once the state is **fulfilled** or **rejected**, the promise state cannot be c…
12 …d of blocking subsequent tasks, the asynchronous task uses a callback or promise to process its re…
15 - **resolve**: a function used to change the promise state from **pending** to **fulfilled**. The p…
16 - **reject**: a function used to change the promise state from **pending** to **rejected**. The par…
27 | napi_resolve_deferred | Resolves a promise by using the **deferred** object associated with it.|
28 | napi_reject_deferred | Rejects a promise by using the **deferred** object associated with it|
78 // Return true if the object passed in is a promise; return false otherwise.
90 …ays check whether the return value is **napi_ok**. If **deferred** and **promise** are used, the a…
96 napi_value promise = nullptr;
101 …reate_promise(env, &deferred, &promise); // If there is an error, return napi_pending_exception wi…
112 …deferred** to change the promise state from **pending** to **fulfilled**, and use **napi_reject_de…
123 napi_value promise = nullptr;
125 napi_status status = napi_create_promise(env, &deferred, &promise);
127 napi_throw_error(env, nullptr, "Create promise failed");
133 napi_is_promise(env, promise, &isPromise);
150 napi_value promise = nullptr;
151 napi_status createStatus = napi_create_promise(env, &deferred, &promise);
153 napi_throw_error(env, nullptr, "Create promise failed");
156 // Set the promise state based on the third parameter.
163 return promise;
181 // Create a promise. Return true if the operation is successful, and return false otherwise.
183 // Call resolveRejectDeferred to resolve or reject the promise and set the promise state.
184 // Resolve the promise. The return value is passed to the then function.
191 // Reject the promise. The return value is passed to the catch function.