|
12 | 12 | * interface for interacting with an object that represents the result of an action that is |
13 | 13 | * performed asynchronously, and may or may not be finished at any given point in time. |
14 | 14 | * |
15 | | - * From the perspective of dealing with error handling, deferred and promise apis are to |
| 15 | + * From the perspective of dealing with error handling, deferred and promise APIs are to |
16 | 16 | * asynchronous programming what `try`, `catch` and `throw` keywords are to synchronous programming. |
17 | 17 | * |
18 | 18 | * <pre> |
|
47 | 47 | * |
48 | 48 | * At first it might not be obvious why this extra complexity is worth the trouble. The payoff |
49 | 49 | * comes in the way of |
50 | | - * [guarantees that promise and deferred apis make](https://github.com/kriskowal/uncommonjs/blob/master/promises/specification.md). |
| 50 | + * [guarantees that promise and deferred APIs make](https://github.com/kriskowal/uncommonjs/blob/master/promises/specification.md). |
51 | 51 | * |
52 | 52 | * Additionally the promise api allows for composition that is very hard to do with the |
53 | 53 | * traditional callback ([CPS](http://en.wikipedia.org/wiki/Continuation-passing_style)) approach. |
|
59 | 59 | * |
60 | 60 | * A new instance of deferred is constructed by calling `$q.defer()`. |
61 | 61 | * |
62 | | - * The purpose of the deferred object is to expose the associated Promise instance as well as apis |
| 62 | + * The purpose of the deferred object is to expose the associated Promise instance as well as APIs |
63 | 63 | * that can be used for signaling the successful or unsuccessful completion of the task. |
64 | 64 | * |
65 | 65 | * **Methods** |
|
136 | 136 | * expect(resolvedValue).toBeUndefined(); |
137 | 137 | * |
138 | 138 | * // Simulate resolving of promise |
139 | | - * defered.resolve(123); |
| 139 | + * deferred.resolve(123); |
140 | 140 | * // Note that the 'then' function does not get called synchronously. |
141 | 141 | * // This is because we want the promise API to always be async, whether or not |
142 | 142 | * // it got called synchronously or asynchronously. |
@@ -317,7 +317,7 @@ function qFactory(nextTick, exceptionHandler) { |
317 | 317 | * |
318 | 318 | * @param {*} value Value or a promise |
319 | 319 | * @returns {Promise} Returns a single promise that will be resolved with an array of values, |
320 | | - * each value coresponding to the promise at the same index in the `promises` array. If any of |
| 320 | + * each value corresponding to the promise at the same index in the `promises` array. If any of |
321 | 321 | * the promises is resolved with a rejection, this resulting promise will be resolved with the |
322 | 322 | * same rejection. |
323 | 323 | */ |
@@ -379,7 +379,7 @@ function qFactory(nextTick, exceptionHandler) { |
379 | 379 | * |
380 | 380 | * @param {Array.<Promise>} promises An array of promises. |
381 | 381 | * @returns {Promise} Returns a single promise that will be resolved with an array of values, |
382 | | - * each value coresponding to the promise at the same index in the `promises` array. If any of |
| 382 | + * each value corresponding to the promise at the same index in the `promises` array. If any of |
383 | 383 | * the promises is resolved with a rejection, this resulting promise will be resolved with the |
384 | 384 | * same rejection. |
385 | 385 | */ |
|
0 commit comments