Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Release 2.2.0

  • Loading branch information...
commit b75a15938579aaccdde136a577bf9e93491ba5f0 1 parent 2af39ad
@ForbesLindesay authored
Showing with 12 additions and 6 deletions.
  1. +10 −4 Readme.md
  2. +1 −1  component.json
  3. +1 −1  package.json
View
14 Readme.md
@@ -48,7 +48,7 @@ function loadDataAsync(id, timeout) {
}
```
- Because the promise can only be resolved once, the rejection will be ignored if the operation is successful within the timeout. A timeout of 0 will also be treated as infinite.
+ Because the promise can only be resolved once, the rejection will be ignored if the operation is successful within the timeout. A timeout of 0 will also be treated as infinite.
## API
@@ -60,7 +60,7 @@ function loadDataAsync(id, timeout) {
#### deferred#promise
- Get the promise represented by the deferred. This is just an object with a function called then.
+ Get the promise represented by the deferred. This is just an object with a function called then.
#### deferred#fulfill(value)
@@ -72,9 +72,15 @@ function loadDataAsync(id, timeout) {
### promise
-#### promise#then(callback, errback, progback)
+#### promise#then(callback, errback)
- You can call then with three optional args. The callback is called when the promise is fulfilled, the errback is called when the promise is rejected. At the moment, progback is ignored. Calls to then can be chained, and you can return a promise from the callback, which will be resolved before being passed to the chained then.
+ You can call then with tow optional args. The callback is called when the promise is fulfilled, the errback is called when the promise is rejected. Then also returns a fresh promise which is set to the result of the callback or errback. If you want to forward a rejection either make errback `null`, or re-throw the error in errback.
+
+ If you return a promise from callback or errback it will be resolved before being set as the result of the promise.
+
+#### promise#done(callback, errback)
+
+ Equivalent to calling then, except you don't get a new promise out and exceptions are never swallowed.
## License
View
2  component.json
@@ -2,7 +2,7 @@
"name": "promises-a",
"repo": "ForbesLindesay/promises-a",
"description": "A bare bones implementation of Promises/A intended to pass https://github.com/domenic/promise-tests while being as small as possible.",
- "version": "2.1.1",
+ "version": "2.2.0",
"keywords": [],
"dependencies": {},
"development": {},
View
2  package.json
@@ -1,6 +1,6 @@
{
"name": "promises-a",
- "version": "2.1.1",
+ "version": "2.2.0",
"description": "A bare bones implementation of Promises/A intended to pass https://github.com/domenic/promise-tests while being as small as possible",
"main": "index.js",
"scripts": {
Please sign in to comment.
Something went wrong with that request. Please try again.