Created
December 18, 2014 23:18
-
-
Save smockle/3f6fa478c82a4b734940 to your computer and use it in GitHub Desktop.
Chaining promises in JavaScript.
This file contains hidden or 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
get("/api/google/sheets/resources") | |
.then(JSON.parse) | |
.then(function (context) { | |
return handlebar("#template", "#output", context); | |
}) | |
.then(function (context) { | |
return pourover(context); | |
}) | |
.then(function (view) { | |
return linkify(view); | |
}) | |
.catch(function(err) { | |
console.error(err); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Wait, why not do: