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`.
99
99
*
100
100
* # Chaining promises
101
101
*
102
- * Because calling `then` api of a promise returns a new derived promise, it is easily possible
102
+ * Because calling the `then` method of a promise returns a new derived promise, it is easily possible
103
103
* to create a chain of promises:
104
104
*
105
105
* <pre>
106
106
* promiseB = promiseA.then(function(result) {
107
107
* return result + 1;
108
108
* });
109
109
*
110
- * // promiseB will be resolved immediately after promiseA is resolved and its value will be
111
- * // the result of promiseA incremented by 1
110
+ * // promiseB will be resolved immediately after promiseA is resolved and its value
111
+ * // will be the result of promiseA incremented by 1
112
112
* </pre>
113
113
*
114
114
* It is possible to create chains of any length and since a promise can be resolved with another
115
115
* promise (which will defer its resolution further), it is possible to pause/defer resolution of
116
- * the promises at any point in the chain. This makes it possible to implement powerful apis like
116
+ * the promises at any point in the chain. This makes it possible to implement powerful APIs like
117
117
* $http's response interceptors.
118
118
*
119
119
*
You can’t perform that action at this time.
0 commit comments