kadet1090 / vuex-typings

Strongly typed vuex
6 stars 2 forks source link

rootState and rootGetters in getter arguments #1

Closed Grawl closed 3 years ago

Grawl commented 3 years ago

VuexActionContext have rootState and rootGetters typings:

https://github.com/kadet1090/vuex-typings/blob/e8301789f51fb2caa493d1c27decd11f9999421c/types/actions.ts#L37

https://github.com/kadet1090/vuex-typings/blob/e8301789f51fb2caa493d1c27decd11f9999421c/types/actions.ts#L38

but in VuexGetter parameters there is only module getters typings

https://github.com/kadet1090/vuex-typings/blob/e8301789f51fb2caa493d1c27decd11f9999421c/types/getters.ts#L8

regarding to Vuex API, there is 4 arguments for any getter: state, getters, rootState, rootGetters

https://vuex.vuejs.org/api/#getters

kadet1090 commented 3 years ago

Thanks for noticing that! I've added TRoot as third parameter to the VuexGetter. It should not be a breaking change as it only adds optional parameter, however the last parameter - TGetters - is now 4th instead of 3rd argument. I don't think that this is a big deal because this parameter is created only to create an alias to use later in type definition and is not intended to be manually overwritten.