Last active
November 16, 2016 09:27
-
-
Save jeygeethan/7409c1e62ee9587618bfc2294f85ed2a to your computer and use it in GitHub Desktop.
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 Promise = require('bluebird'); | |
function aSync() { | |
return new Promise(function(resolve, reject) { | |
setTimeout(function() { | |
console.log('inside the aSync') | |
resolve(); | |
}, 3000); | |
}) | |
} | |
aSync().then(function(data) { | |
return new Promise(function(resolve, reject) { | |
setTimeout(function() { | |
console.log('inside then'); | |
resolve(); | |
}, 5000); | |
}) | |
}).then(function(data) { | |
console.log('bye'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment