Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
rsvp.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
rsvp.js
Commits
da484cfd
Commit
da484cfd
authored
Jun 01, 2013
by
Stefan Penner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update README.md
parent
d54f9c2d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
README.md
README.md
+2
-3
No files found.
README.md
View file @
da484cfd
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment