{"action":"created","issue":{"url":"https://api.github.com/repos/vuejs/vuex/issues/385","repository_url":"https://api.github.com/repos/vuejs/vuex","labels_url":"https://api.github.com/repos/vuejs/vuex/issues/385/labels{/name}","comments_url":"https://api.github.com/repos/vuejs/vuex/issues/385/comments","events_url":"https://api.github.com/repos/vuejs/vuex/issues/385/events","html_url":"https://github.com/vuejs/vuex/issues/385","id":182245700,"number":385,"title":"Can't access getter from store module","user":{"login":"rightaway","id":3680078,"avatar_url":"https://avatars.githubusercontent.com/u/3680078?v=3","gravatar_id":"","url":"https://api.github.com/users/rightaway","html_url":"https://github.com/rightaway","followers_url":"https://api.github.com/users/rightaway/followers","following_url":"https://api.github.com/users/rightaway/following{/other_user}","gists_url":"https://api.github.com/users/rightaway/gists{/gist_id}","starred_url":"https://api.github.com/users/rightaway/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rightaway/subscriptions","organizations_url":"https://api.github.com/users/rightaway/orgs","repos_url":"https://api.github.com/users/rightaway/repos","events_url":"https://api.github.com/users/rightaway/events{/privacy}","received_events_url":"https://api.github.com/users/rightaway/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/vuejs/vuex/labels/2.0","name":"2.0","color":"f9d0c4"},{"url":"https://api.github.com/repos/vuejs/vuex/labels/need%20repro","name":"need repro","color":"eb6420"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-10-11T12:02:16Z","updated_at":"2016-10-11T12:39:27Z","closed_at":"2016-10-11T12:39:27Z","body":"If I register a module like this\r\n\r\n```\r\nstore.registerModule('sub', {\r\n  state: {\r\n    A: 'a',\r\n  },\r\n  getters: {\r\n    B: (state) => {\r\n      return doSomething(state.A);\r\n    }\r\n  }\r\n});\r\n```\r\n\r\nThen in my component I can do `$store.state.sub.A`, but I can't get access to the getter `B`. `$store.getters` is empty and so is `$store.sub`."},"comment":{"url":"https://api.github.com/repos/vuejs/vuex/issues/comments/252905136","html_url":"https://github.com/vuejs/vuex/issues/385#issuecomment-252905136","issue_url":"https://api.github.com/repos/vuejs/vuex/issues/385","id":252905136,"user":{"login":"rightaway","id":3680078,"avatar_url":"https://avatars.githubusercontent.com/u/3680078?v=3","gravatar_id":"","url":"https://api.github.com/users/rightaway","html_url":"https://github.com/rightaway","followers_url":"https://api.github.com/users/rightaway/followers","following_url":"https://api.github.com/users/rightaway/following{/other_user}","gists_url":"https://api.github.com/users/rightaway/gists{/gist_id}","starred_url":"https://api.github.com/users/rightaway/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rightaway/subscriptions","organizations_url":"https://api.github.com/users/rightaway/orgs","repos_url":"https://api.github.com/users/rightaway/repos","events_url":"https://api.github.com/users/rightaway/events{/privacy}","received_events_url":"https://api.github.com/users/rightaway/received_events","type":"User","site_admin":false},"created_at":"2016-10-11T12:39:27Z","updated_at":"2016-10-11T12:39:27Z","body":"Actually I've just realized the mistake was mine for assuming that getters are keyed under the module name like state is. So it's `$store.state.sub.A` but not `$store.getters.sub.B`. Just curious if there was some reason it was designed like this, with the inconsistency between state and getters?"}}
{"actor":{"display_login":"rightaway"}}