Created
May 29, 2015 03:15
-
-
Save Rokt33r/967adab57e8aad110934 to your computer and use it in GitHub Desktop.
Promise Chain
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
var makePromise = function (str) { | |
console.log(str) | |
return new Promise(function(resolve, reject){ | |
setTimeout(function(){resolve(str+1)}, 1000) | |
}) | |
} | |
makePromise(1).then(makePromise).then(makePromise).then(makePromise) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment