ktsn / vuex-class

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

Infer the property name in namespaces too #27

Closed Samitier closed 6 years ago

Samitier commented 6 years ago

Hello,

Right now, thanks to #1, we can use the decorator without parameters:

  @State foo
  @Getter bar
  @Action baz

But when using modules and namespaces, the decorator parameter is still mandatory:

const someModule = namespace('path/to/module')

[...]

@someModule.State('foo') foo

Would it be possible to infer the property name in namespaces too to make the code more consistent?

Thanks!

ktsn commented 6 years ago

Well, you already can omit property name on namespaced helpers. https://github.com/ktsn/vuex-class/blob/master/test/bindings.ts#L81

Samitier commented 6 years ago

Oh sure, my bad!

Thank you @ktsn !