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

用TypeScript2.8引入的新类型ReturnType获取函数返回值 #3

Closed
liaokaien opened this issue Mar 22, 2019 · 0 comments
Closed

Comments

@liaokaien
Copy link

看到目前代码里ReturnState 和 ActionType 都用Conditional Types 获取函数的返回值,其实TypeScript 2.8 已经内置了一个利用Conditional Types获取函数返回值的类型 ReturnType,可以用在ReturnState和ActionType的定义里简化代码。 🙂

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

No branches or pull requests

1 participant