sascha245 / vuex-simple

A simpler way to write your Vuex store in Typescript
MIT License
180 stars 15 forks source link

Fix removing leading slash for root action, mutation and getter #21

Closed geerpm closed 5 years ago

geerpm commented 5 years ago

Root store's action/mutation/getter does not working because leading slash in name.

// src/store.ts
const getterName = pBuilder.namespaces.join('/') + '/' + propertyName;
const mutationName = pBuilder.namespaces.join('/') + '/' + propertyName;
const actionName = pBuilder.namespaces.join('/') + '/' + propertyName;
// src/store.ts
const nsPath = pBuilder.namespaces.join('/');
const getterName = (nsPath ? nsPath + '/' : '') + propertyName;
// same changes for mutationName, actionName
sascha245 commented 5 years ago

Hi @geerpm,

Thanks for the fix, I will publish the changes as soon as possible

Sascha