Created
June 10, 2013 02:14
-
-
Save ginpei/5746126 to your computer and use it in GitHub Desktop.
function's chaining
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
// (start) -> Any jobs... -> "OK 1" -> Any jobs... -> "OK 3" -> Any jobs... -> "OK 3" | |
Promise(function(resolve) { | |
console.log('OK 1'); | |
setTimeout(resolve, 1000); | |
}).then(function() { | |
Promise(function(resolve) { | |
console.log('OK 2'); | |
setTimeout(resolve, 1000); | |
}).then(function() { | |
console.log('OK 3'); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment