{"action":"created","issue":{"url":"https://api.github.com/repos/vuejs/vuex/issues/241","repository_url":"https://api.github.com/repos/vuejs/vuex","labels_url":"https://api.github.com/repos/vuejs/vuex/issues/241/labels{/name}","comments_url":"https://api.github.com/repos/vuejs/vuex/issues/241/comments","events_url":"https://api.github.com/repos/vuejs/vuex/issues/241/events","html_url":"https://github.com/vuejs/vuex/issues/241","id":164097134,"number":241,"title":"2.0 modules","user":{"login":"pdcmoreira","id":4430606,"avatar_url":"https://avatars.githubusercontent.com/u/4430606?v=3","gravatar_id":"","url":"https://api.github.com/users/pdcmoreira","html_url":"https://github.com/pdcmoreira","followers_url":"https://api.github.com/users/pdcmoreira/followers","following_url":"https://api.github.com/users/pdcmoreira/following{/other_user}","gists_url":"https://api.github.com/users/pdcmoreira/gists{/gist_id}","starred_url":"https://api.github.com/users/pdcmoreira/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pdcmoreira/subscriptions","organizations_url":"https://api.github.com/users/pdcmoreira/orgs","repos_url":"https://api.github.com/users/pdcmoreira/repos","events_url":"https://api.github.com/users/pdcmoreira/events{/privacy}","received_events_url":"https://api.github.com/users/pdcmoreira/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-07-06T14:59:38Z","updated_at":"2016-07-08T05:10:56Z","closed_at":null,"body":"Is Vuex 2.0 working with modules?\r\n\r\nI have a configuration module:\r\n\r\n```javascript\r\nconst state = {\r\n    locale: {\r\n        available: [],\r\n        current: null,\r\n        mode: null\r\n    }\r\n}\r\n\r\nconst getters = {\r\n    all (state) {\r\n        return state.configuration;\r\n    },\r\n    \r\n    locale (state) {\r\n        return state.configuration.locale;\r\n    }\r\n}\r\n\r\nconst mutations = {\r\n    LOAD_CONFIGURATION (state, config) {\r\n        state.locale = config.locale;\r\n    },\r\n    \r\n    SET_LOCALE (state, locale) {\r\n        state.locale.current = locale;\r\n    }\r\n}\r\n\r\nexport default {\r\n    state,\r\n    getters,\r\n    mutations\r\n}\r\n```\r\n\r\nI'm able to access the state through `this.$store.state.configuration`, but I can't call any getter.\r\nI would expect that doing something like `this.$store.configuration.all` or `this.$store.configuration.getters.all` or even `this.$store.getters.configuration.all` would work, but they don't (all of them give me undefined errors)."},"comment":{"url":"https://api.github.com/repos/vuejs/vuex/issues/comments/231276302","html_url":"https://github.com/vuejs/vuex/issues/241#issuecomment-231276302","issue_url":"https://api.github.com/repos/vuejs/vuex/issues/241","id":231276302,"user":{"login":"ktsn","id":2194624,"avatar_url":"https://avatars.githubusercontent.com/u/2194624?v=3","gravatar_id":"","url":"https://api.github.com/users/ktsn","html_url":"https://github.com/ktsn","followers_url":"https://api.github.com/users/ktsn/followers","following_url":"https://api.github.com/users/ktsn/following{/other_user}","gists_url":"https://api.github.com/users/ktsn/gists{/gist_id}","starred_url":"https://api.github.com/users/ktsn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ktsn/subscriptions","organizations_url":"https://api.github.com/users/ktsn/orgs","repos_url":"https://api.github.com/users/ktsn/repos","events_url":"https://api.github.com/users/ktsn/events{/privacy}","received_events_url":"https://api.github.com/users/ktsn/received_events","type":"User","site_admin":false},"created_at":"2016-07-08T05:10:56Z","updated_at":"2016-07-08T05:10:56Z","body":"Hmm, as you said, it may be strange to prefix to them.\r\nActually, I'm using Vuex in a huge system too and writing prefixed and flatten getters, but I don't feel resistance about that. (It's Vuex 1.0 but I'm writing getters in the same structure to 2.0)\r\n\r\nI guess it is because I rename the getters when I use them in components.\r\nIn Vuex 2.0, `mapGetters` helper can map getters to renamed and computed property.\r\n```js\r\nexport default {\r\n  computed: mapGetters({\r\n    integration: 'documentManagementErpIntegration'\r\n  }),\r\n  created() {\r\n    console.log(this.integration)\r\n  }\r\n}\r\n```\r\n\r\nIf this does not make sense for you, could you explain painful situation when you use such getters?\r\nIt probably helps the improvement of Vuex :)"}}
{"actor":{"display_login":"ktsn"}}