Skip to content

JsCreatePromise

Limin Zhu edited this page Mar 16, 2017 · 1 revision

Creates a new JavaScript Promise object.

Syntax

CHAKRA_API
	JsCreatePromise(
	    _Out_ JsValueRef *promise,
	    _Out_ JsValueRef *resolveFunction,
	    _Out_ JsValueRef *rejectFunction);

Parameters

  • promise: The new Promise object.
  • resolveFunction: The function called to resolve the created Promise object.
  • rejectFunction: The function called to reject the created Promise object.

Return Value

The code JsNoError if the operation succeeded, a failure code otherwise.

Remarks

This API is experimental and may have breaking change later.

Requires an active script context.

Clone this wiki locally