Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should yield* be the recommendation in co's documentation? #136

Closed
jeswin opened this issue Jul 18, 2014 · 2 comments · Fixed by #154
Closed

Should yield* be the recommendation in co's documentation? #136

jeswin opened this issue Jul 18, 2014 · 2 comments · Fixed by #154

Comments

@jeswin
Copy link

jeswin commented Jul 18, 2014

Since yield* can give better stack traces and error reporting, should that be the recommendation in co's documentation? When using just yield, all you get is the final generator function with no reference to who invoked it.

@jonathanong
Copy link
Contributor

sure, but you need REALLY GOOD DOCS otherwise you're going to confuse more people than you help. i consider yield* a more advanced topic

@jeswin
Copy link
Author

jeswin commented Jul 18, 2014

I agree. Also, switching to yield* doesn't solve the problem by itself. If the final method is a thunkified version of a node-style API (which is pretty much always), you will need to catch that exception in the inner-most generator and re-throw after adding generator-specific call stack information. I have no idea how that could be explained. :/

Having said that, until making the change above my debugging was limited to placing console.log calls everywhere and hoping for the best.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants