Skip to content

Instantly share code, notes, and snippets.

@jeygeethan
Last active November 16, 2016 09:27
Show Gist options
  • Save jeygeethan/7409c1e62ee9587618bfc2294f85ed2a to your computer and use it in GitHub Desktop.
Save jeygeethan/7409c1e62ee9587618bfc2294f85ed2a to your computer and use it in GitHub Desktop.
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