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

Use keyof to improve type inference in helpers #1105

Closed
wants to merge 3 commits into from

Conversation

Demivan
Copy link

@Demivan Demivan commented Dec 26, 2017

Using map helpers (mapState, mapMutations, mapGetters or mapActions) breaks type checking in Vue components.
This pull request uses keyof Typescript 2.1 feature to fix this.
Before change:
beforechangethis
beforechange
After change:
afterchangethis
afterchange
Breaking change: When using functions as mappings, first parameter (Commit, Dispatch) type is not inferred, but it is type-checked only.

@ktsn
Copy link
Member

ktsn commented Jan 4, 2018

Thank you for the contribution. However I'm actually just making a major update for helper types which includes the fix to this problem and improvements to use strictly typed getters/actions/mutations. (See #1121)

Sorry for the inconvenience. I hope you did not mind to use #1121 as the fix for this problem.

@Demivan
Copy link
Author

Demivan commented Jan 4, 2018

Glad to hear that. #1121 works fine for me.
Closing this pull request

@Demivan Demivan closed this Jan 4, 2018
@Demivan Demivan deleted the feature/improve-helpers-typings branch January 5, 2018 09:20
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