diff --git a/packages/typed-vuex/src/accessor.ts b/packages/typed-vuex/src/accessor.ts index cc1666a..06258b1 100644 --- a/packages/typed-vuex/src/accessor.ts +++ b/packages/typed-vuex/src/accessor.ts @@ -49,9 +49,8 @@ const createAccessor = ( Object.keys(evaluatedState).forEach(prop => { if (!Object.getOwnPropertyNames(accessor).includes(prop)) { const namespaces = namespace.split('/') - const state = getNestedState(store.state, namespaces) Object.defineProperty(accessor, prop, { - get: () => state[prop], + get: () => getNestedState(store.state, namespaces)[prop], }) } })