This repository was archived by the owner on Apr 12, 2024. It is now read-only.
File tree 1 file changed +6
-6
lines changed
1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 85
85
* **Methods**
86
86
*
87
87
* - `then(successCallback, errorCallback)` – regardless of when the promise was or will be resolved
88
- * or rejected calls one of the success or error callbacks asynchronously as soon as the result
89
- * is available. The callbacks are called with a single argument the result or rejection reason.
88
+ * or rejected, `then` calls one of the success or error callbacks asynchronously as soon as the result
89
+ * is available. The callbacks are called with a single argument: the result or rejection reason.
90
90
*
91
91
* This method *returns a new promise* which is resolved or rejected via the return value of the
92
92
* `successCallback` or `errorCallback`.
93
93
*
94
94
*
95
95
* # Chaining promises
96
96
*
97
- * Because calling `then` api of a promise returns a new derived promise, it is easily possible
97
+ * Because calling the `then` method of a promise returns a new derived promise, it is easily possible
98
98
* to create a chain of promises:
99
99
*
100
100
* <pre>
101
101
* promiseB = promiseA.then(function(result) {
102
102
* return result + 1;
103
103
* });
104
104
*
105
- * // promiseB will be resolved immediately after promiseA is resolved and its value will be
106
- * // the result of promiseA incremented by 1
105
+ * // promiseB will be resolved immediately after promiseA is resolved and its value
106
+ * // will be the result of promiseA incremented by 1
107
107
* </pre>
108
108
*
109
109
* It is possible to create chains of any length and since a promise can be resolved with another
110
110
* promise (which will defer its resolution further), it is possible to pause/defer resolution of
111
- * the promises at any point in the chain. This makes it possible to implement powerful apis like
111
+ * the promises at any point in the chain. This makes it possible to implement powerful APIs like
112
112
* $http's response interceptors.
113
113
*
114
114
*
You can’t perform that action at this time.
0 commit comments