Skip to content

Instantly share code, notes, and snippets.

@dllmoe
Created July 27, 2017 06:47
Show Gist options
  • Select an option

  • Save dllmoe/5a4e04c5b1b856e5024173d950708dfc to your computer and use it in GitHub Desktop.

Select an option

Save dllmoe/5a4e04c5b1b856e5024173d950708dfc to your computer and use it in GitHub Desktop.
异步
function go(func){
let gen = func()
function next(data){
if(!data.done) data.value.next(dt => next(gen.next(dt)))
}
return next(gen.next())
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment