Skip to content

Commit

Permalink
Update promise documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
kfarnung committed May 10, 2018
1 parent 06eef3d commit 9edbe68
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 0 deletions.
3 changes: 3 additions & 0 deletions JavaScript-Runtime-(JSRT)-Reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ References of JSRT typedefs, constants, enumerations and APIs.
* [[JsModuleHostInfoKind]]
* [[JsParseModuleSourceFlags]]
* [[JsParseScriptAttributes]]
* [[JsPromiseState]]
* [[JsPropertyIdType]]
* [[JsRuntimeAttributes]]
* [[JsTypedArrayType]]
Expand Down Expand Up @@ -107,6 +108,8 @@ References of JSRT typedefs, constants, enumerations and APIs.
* [[JsGetOwnPropertyDescriptor]]
* [[JsGetOwnPropertyNames]]
* [[JsGetOwnPropertySymbols]]
* [[JsGetPromiseResult]]
* [[JsGetPromiseState]]
* [[JsGetProperty]]
* [[JsGetPropertyIdFromName]]
* [[JsGetPropertyIdFromSymbol]]
Expand Down
21 changes: 21 additions & 0 deletions reference/JsGetPromiseResult.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Gets the result of a given `Promise` object.

### Syntax
```
CHAKRA_API
JsGetPromiseResult(
_In_ JsValueRef *promise,
_Out_ JsValueRef *result);
```

### Parameters
* __promise__: The `Promise` object.
* __result__: The result of the `Promise`.

### 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.
21 changes: 21 additions & 0 deletions reference/JsGetPromiseState.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Gets the state of a given `Promise` object.

### Syntax
```
CHAKRA_API
JsGetPromiseState(
_In_ JsValueRef *promise,
_Out_ JsPromiseState *state);
```

### Parameters
* __promise__: The `Promise` object.
* __state__: The current state of the `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.
11 changes: 11 additions & 0 deletions reference/JsPromiseState.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
The possible states for a `Promise` object.

### Syntax
```
enum JsPromiseState
```

### Members
* __JsPromiseState_Pending__: The `Promise` has not yet been fulfilled or rejected.
* __JsPromiseState_Fulfilled__: The `Promise` has been fulfilled.
* __JsPromiseState_Rejected__: The `Promise` has been rejected.

0 comments on commit 9edbe68

Please sign in to comment.