Closed NikhilVerma closed 2 years ago
This feels like a dirty workaround, and Typescript still throws an error when this MutationAction is called:
import HGAPIModule from './path/to/HGAPIModule.ts`;
await HGAPIModule.fetchAll();
// The 'this' context of type 'HGAPIModule' is not assignable to method's 'this' of type 'Store<HGAPIModule>'.
This has been fixed actually. This is the state now.
From this PR https://github.com/championswimmer/vuex-module-decorators/issues/372 it's evident that people can misunderstand how
MutationAction
works.By updating the documentation to explain how to correctly set the
this
type inside it will help them to understand how the context works for that decorator.