Created
May 4, 2015 10:38
-
-
Save wtfil/46a265891017fa63fd70 to your computer and use it in GitHub Desktop.
promises
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// nested | |
callA().then(function () { | |
return callB().then(function () { | |
return callC() | |
}); | |
}); | |
// equivalent | |
callA().then(function () { | |
return callB(); | |
}).then(function () { | |
return callC(); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
callA().then(callB).then(callC)