Created
May 18, 2017 06:21
-
-
Save brn/095ffed2dea2464d82dda000e83f6b50 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
const hello = () => new Promise(resolve => setTimeout(() => resolve("hello"), 300)); | |
const world = () => new Promise(resolve => setTimeout(() => resolve("world"), 300)); | |
co(function* () { | |
var hello = yield hello(); | |
var world = yield world(); | |
return `${hello} ${world}`; | |
}).then(word => console.log(value)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment