In the following code, why is the state of moduleA accessed with store.state.a instead of store.a.state?
Since the store holds moduleA, and moduleA holds its state, it makes more sense to me if the state of moduleA was accessed with store.a.state.
const moduleA = {
state: () => ({ ... }),
...
}
const moduleB = {
state: () => ({ ... }),
...
}
const store = new Vuex.Store({
modules: {
a: moduleA,
b: moduleB
}
})
store.state.a // -> `moduleA`'s state
store.state.b // -> `moduleB`'s state