ktsn/vuex-class

typescript cannot infer type

GopherJ opened this issue · 4 comments

Questions

Typescript cannot infer correctly the type, am I wrong somewhere?

Screenshot from 2019-03-30 13-00-47

This fixed it for me: #33 (comment)

Try @AclModule.Mutation(UPDATE_ACL_FILTER) updateAclFilter!: () => void;

@austindebruyn Thanks! It works like a charm!

kamok commented

Why can't we use TypeScript implicit typing? We have access to the Actions and its typing. Is there a way to make it work?

Because of decorators not being able to set the type of what it's decorating.... Composition API gives you the ability to infer types.