Commit da484cfd authored by Stefan Penner's avatar Stefan Penner

Update README.md

parent d54f9c2d
...@@ -41,7 +41,6 @@ promise.then(function(value) { ...@@ -41,7 +41,6 @@ promise.then(function(value) {
}); });
``` ```
Once a promise has been resolved or rejected, it cannot be resolved or Once a promise has been resolved or rejected, it cannot be resolved or
rejected again. rejected again.
...@@ -89,7 +88,7 @@ getJSON("/posts.json").then(function(json) { ...@@ -89,7 +88,7 @@ getJSON("/posts.json").then(function(json) {
return json.post; return json.post;
}).then(function(post) { }).then(function(post) {
// proceed // proceed
});; });
``` ```
The really awesome part comes when you return a promise from the first The really awesome part comes when you return a promise from the first
...@@ -101,7 +100,7 @@ getJSON("/post/1.json").then(function(post) { ...@@ -101,7 +100,7 @@ getJSON("/post/1.json").then(function(post) {
return getJSON(post.commentURL); return getJSON(post.commentURL);
}).then(function(comments) { }).then(function(comments) {
// proceed with access to posts and comments // proceed with access to posts and comments
});; });
``` ```
This allows you to flatten out nested callbacks, and is the main feature This allows you to flatten out nested callbacks, and is the main feature
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment