@@ -8,10 +8,10 @@ _Type parameters: `<R>`_
8
8
9
9
10
10
## Constructor
11
- If you call resolve in the body of the callback passed to the constructor,
12
- your promise is fulfilled with result object passed to resolve.
13
- If you call reject your promise is rejected with the object passed to resolve.
14
- For consistency and debugging (eg stack traces), obj should be an instanceof Error.
11
+ If you call resolve in the body of the callback passed to the constructor,
12
+ your promise is fulfilled with result object passed to resolve.
13
+ If you call reject your promise is rejected with the object passed to resolve.
14
+ For consistency and debugging (eg stack traces), obj should be an instanceof Error.
15
15
Any errors thrown in the constructor callback will be implicitly passed to reject().
16
16
17
17
** Signature:** ` constructor(callback: (resolve: (value?: R | Thenable<R>) => void,reject: (error?: any) => void) => void) `
@@ -46,11 +46,11 @@ Any errors thrown in the constructor callback will be implicitly passed to rejec
46
46
47
47
### then<U >
48
48
49
- onFulfilled is called when/if "promise" resolves. onRejected is called when/if "promise" rejects.
50
- Both are optional, if either/both are omitted the next onFulfilled/onRejected in the chain is called.
51
- Both callbacks have a single parameter , the fulfillment value or rejection reason.
52
- "then" returns a new promise equivalent to the value you return from onFulfilled/onRejected after being passed through Promise.resolve.
53
- If an error is thrown in the callback, the returned promise rejects with that error.
49
+ onFulfilled is called when/if "promise" resolves. onRejected is called when/if "promise" rejects.
50
+ Both are optional, if either/both are omitted the next onFulfilled/onRejected in the chain is called.
51
+ Both callbacks have a single parameter , the fulfillment value or rejection reason.
52
+ "then" returns a new promise equivalent to the value you return from onFulfilled/onRejected after being passed through Promise.resolve.
53
+ If an error is thrown in the callback, the returned promise rejects with that error.
54
54
55
55
56
56
** Signature:** `` then<U>(onFulfilled?: (value: R) => U | Thenable<U>,onRejected?: (error: any) => U | Thenable<U>): Promise<U> ``
@@ -89,7 +89,7 @@ If an error is thrown in the callback, the returned promise rejects with that er
89
89
90
90
### catch<U >
91
91
92
- Sugar for promise.then(undefined,onRejected)
92
+ Sugar for promise.then(undefined,onRejected)
93
93
94
94
95
95
** Signature:** `` catch<U>(onRejected?: (error: any) => U | Thenable<U>): Promise<U> ``
@@ -104,4 +104,3 @@ Sugar for promise.then(undefined,onRejected)
104
104
| Parameter | Type | Description |
105
105
| :-------------| :---------------| :------------|
106
106
| ` onRejected ` | ` (error: any) => U ` ,[ ` Thenable<U> ` ] ( ../es6-promise/thenable.md ) | _ Optional._ called when/if "promise" rejects |
107
-
0 commit comments