ktsn / vuex-class

Binding helpers for Vuex and vue-class-component
MIT License
1.73k stars 86 forks source link

type Getter<S,R> should declare optional parameters #56

Open kbirger opened 4 years ago

kbirger commented 4 years ago

Currently, the definition is:

export type Getter<S, R> = (state: S, getters: any, rootState: R, rootGetters: any) => any;

every parameter other than state: S is actually optional, and should be declared as such.

Right now this is keeping me from actually using these types, because using them would make my unit test code messy with extraneous null-valued params.

Also, could you provide some guidance on when these typings are actually useful? As far as I know, these classes are never used directly, but rather by Vuex internals.