Closed
Description
Right now it's hard to maintain type safety with Vuex
and Typescript
because of the way the $store
exposes actions and mutations through string-based dispatch
and commit
. At compile time there's no way to know the strings are valid or that the passed payload has the requisite fields.
There's this valiant effort:
- https://github.com/HerringtonDarkholme/kilimanjaro
- https://herringtondarkholme.github.io/2016/10/03/vue2-ts2/
Though that API doesn't really look like the Vuex
API to me. Would there be interest in trying to allow typescript type safety in Vuex? Are there existing best practices?