Skip to content

Instantly share code, notes, and snippets.

@mkuklis
Last active January 4, 2016 07:59
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 mkuklis/8592005 to your computer and use it in GitHub Desktop.
Save mkuklis/8592005 to your computer and use it in GitHub Desktop.
simple run
function run(genfun) {
var gen = genfun();
function next(err, answer) {
if (err) {
return gen.throw(err);
}
var res = gen.next(answer);
if (!res.done) {
res.value(next);
}
}
next();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment