Skip to content

Instantly share code, notes, and snippets.

@Hydrock
Created May 29, 2018 17:17
Show Gist options
  • Select an option

  • Save Hydrock/eaf6a11c2b565aaa24c6a35c77db1ed2 to your computer and use it in GitHub Desktop.

Select an option

Save Hydrock/eaf6a11c2b565aaa24c6a35c77db1ed2 to your computer and use it in GitHub Desktop.
async = generator => {
const generator = generatorCreator();
function next(value) {
const nextResult = generator.next(value);
if (nextResult.done) return nextResult.value;
nextResult.value.then(next);
};
next();
}
@karavanjo

Copy link
Copy Markdown

async = generator => should be replaced to async = () => or will be raised error Duplicate declaration generator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment