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
建议给 public api 包一层 co.wrap #87
Comments
Good point! @fengmk2 @dead-horse 怎么看? |
这个不由此模块来做,你可以发布一个新模块来做这件事情 |
等async 变成node内置,我们会直接提供async接口 |
增加一个 |
但是 fn = co.wrap genfn 的结果就是一个async function啊。除了 fn.length 不一样外。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
现在 对外暴露的 API 都是直接的 generator function, 只能配合着 co yield 使用。
包上一层 co.wrap 之后,api方法返回的是 Promise, 可以配合 yield / await / or直接then 使用。
The text was updated successfully, but these errors were encountered: