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获取函数返回值 #4

Closed
wants to merge 2 commits into from
Closed

Conversation

liaokaien
Copy link

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

@jasonHzq
Copy link
Contributor

解决一下冲突哈~

@jasonHzq
Copy link
Contributor

代码没有问题,之前 ReturnType 没来得及替换。

@liaokaien
Copy link
Author

冲突已解决~

@liaokaien liaokaien closed this by deleting the head repository Oct 28, 2023
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 this pull request may close these issues.

2 participants