Skip to content

Instantly share code, notes, and snippets.

@brn
Created May 18, 2017 06:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brn/095ffed2dea2464d82dda000e83f6b50 to your computer and use it in GitHub Desktop.
Save brn/095ffed2dea2464d82dda000e83f6b50 to your computer and use it in GitHub Desktop.
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