Created
September 22, 2018 23:33
-
-
Save nem035/3bd038ea6338f2e0f8e1e05a82351a25 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
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