Skip to content

Instantly share code, notes, and snippets.

@nem035
Created September 22, 2018 23:33
Show Gist options
  • Save nem035/3bd038ea6338f2e0f8e1e05a82351a25 to your computer and use it in GitHub Desktop.
Save nem035/3bd038ea6338f2e0f8e1e05a82351a25 to your computer and use it in GitHub Desktop.
var fn = co.wrap(function* (val) {
// we can yield a promise
// which behaves like await-ing it
return yield Promise.resolve(val);
});
fn(true).then(function (val) {
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment