Skip to content

Instantly share code, notes, and snippets.

@Rokt33r
Created May 29, 2015 03:15
Show Gist options
  • Save Rokt33r/967adab57e8aad110934 to your computer and use it in GitHub Desktop.
Save Rokt33r/967adab57e8aad110934 to your computer and use it in GitHub Desktop.
Promise Chain
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