Last active
October 8, 2017 10:28
-
-
Save ivantsov/d389881e389f2ec386fcf7e9492ad5c5 to your computer and use it in GitHub Desktop.
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
function foo() { | |
console.log('foo'); | |
return new Promise(resolve => { | |
console.log('foo timeout before'); | |
setTimeout(() => { | |
console.log('foo timeout'); | |
resolve('foo resolved'); | |
}, 1000); | |
console.log('foo timeout after'); | |
}); | |
} | |
function bar() { | |
console.log('bar'); | |
return new Promise(resolve => { | |
console.log('bar timeout before'); | |
setTimeout(() => { | |
console.log('bar timeout'); | |
resolve('bar resolved'); | |
}, 3000); | |
console.log('bar timeout after'); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment