{"action":"created","issue":{"url":"https://api.github.com/repos/posva/vuexfire/issues/10","repository_url":"https://api.github.com/repos/posva/vuexfire","labels_url":"https://api.github.com/repos/posva/vuexfire/issues/10/labels{/name}","comments_url":"https://api.github.com/repos/posva/vuexfire/issues/10/comments","events_url":"https://api.github.com/repos/posva/vuexfire/issues/10/events","html_url":"https://github.com/posva/vuexfire/issues/10","id":190478152,"number":10,"title":"Where to put moduleMutations()?","user":{"login":"ryanmclaughlin","id":451112,"avatar_url":"https://avatars.githubusercontent.com/u/451112?v=3","gravatar_id":"","url":"https://api.github.com/users/ryanmclaughlin","html_url":"https://github.com/ryanmclaughlin","followers_url":"https://api.github.com/users/ryanmclaughlin/followers","following_url":"https://api.github.com/users/ryanmclaughlin/following{/other_user}","gists_url":"https://api.github.com/users/ryanmclaughlin/gists{/gist_id}","starred_url":"https://api.github.com/users/ryanmclaughlin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryanmclaughlin/subscriptions","organizations_url":"https://api.github.com/users/ryanmclaughlin/orgs","repos_url":"https://api.github.com/users/ryanmclaughlin/repos","events_url":"https://api.github.com/users/ryanmclaughlin/events{/privacy}","received_events_url":"https://api.github.com/users/ryanmclaughlin/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-11-19T05:30:21Z","updated_at":"2016-11-19T19:53:19Z","closed_at":"2016-11-19T19:53:19Z","body":"I'm testing the new modules update and am having some trouble.\r\n\r\n**EDIT:** I think I may be misunderstanding how vuexfire works with mutations. Does it automagically make them for us?\r\n\r\nI'm getting the error: \r\n![image](https://cloud.githubusercontent.com/assets/451112/20453333/b012638c-add5-11e6-8998-6e590c79acb2.png)\r\n\r\nHere's the lay of the land:\r\n\r\n**/vuex/modules/auth/actions.js**\r\n```\r\nimport firebase from '../../../services/firebase.js'\r\n\r\nimport { AUTHENTICATE } from './mutation-types';\r\n\r\nexport function fetchUser ({ commit }) {\r\n  return firebase.auth.onAuthStateChanged((user) => {\r\n    commit(AUTHENTICATE, user);\r\n  });\r\n}\r\n```\r\n\r\n**/vuex/modules/auth/getters.js**\r\n`export const getAuth = state => state.user`\r\n\r\n\r\n**/vuex/modules/auth/index.js**\r\n```\r\nimport * as actions from './actions';\r\nimport * as getters from './getters';\r\n\r\nimport { AUTHENTICATE } from './mutation-types'\r\n\r\nconst initialState = {\r\n  user: null\r\n}\r\n\r\nconst mutations = {\r\n  [AUTHENTICATE] (state, user) {\r\n    state.user = user\r\n  },\r\n}\r\n\r\nexport default {\r\n  state: { ...initialState },\r\n  actions,\r\n  getters,\r\n  mutations,\r\n}\r\n```\r\n\r\n**/vuex/modules/auth/mutation-types.js**\r\n`export const AUTHENTICATE = 'auth/AUTHENTICATE';`\r\n\r\n**/vuex/modules/store.js**\r\n```\r\nimport Vue from 'vue'\r\nimport Vuex from 'vuex'\r\nimport VuexFire from 'vuexfire'\r\n\r\nimport auth from './modules/auth'\r\nimport games from './modules/games'\r\n\r\nVue.use(Vuex)\r\nVue.use(VuexFire)\r\n\r\nconst debug = process.env.NODE_ENV !== 'production'\r\n\r\nexport default new Vuex.Store({\r\n  modules: {\r\n    auth,\r\n    games,\r\n  },\r\n  strict: debug,\r\n})\r\n```\r\n\r\n**App.vue**\r\n```\r\n  export default {\r\n    components: {\r\n      AppNav\r\n    },\r\n    created () {\r\n      this.$store.dispatch('fetchGames');\r\n      this.$store.dispatch('fetchUser');\r\n    }\r\n  }\r\n```\r\n\r\nThe only thing I'm able to find is that with I'm supposed to use `mutations: VuexFire.moduleMutations('items')` somewhere if I'm using modules, and I'm not sure where though in a setup like this.\r\n"},"comment":{"url":"https://api.github.com/repos/posva/vuexfire/issues/comments/261735504","html_url":"https://github.com/posva/vuexfire/issues/10#issuecomment-261735504","issue_url":"https://api.github.com/repos/posva/vuexfire/issues/10","id":261735504,"user":{"login":"posva","id":664177,"avatar_url":"https://avatars.githubusercontent.com/u/664177?v=3","gravatar_id":"","url":"https://api.github.com/users/posva","html_url":"https://github.com/posva","followers_url":"https://api.github.com/users/posva/followers","following_url":"https://api.github.com/users/posva/following{/other_user}","gists_url":"https://api.github.com/users/posva/gists{/gist_id}","starred_url":"https://api.github.com/users/posva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/posva/subscriptions","organizations_url":"https://api.github.com/users/posva/orgs","repos_url":"https://api.github.com/users/posva/repos","events_url":"https://api.github.com/users/posva/events{/privacy}","received_events_url":"https://api.github.com/users/posva/received_events","type":"User","site_admin":false},"created_at":"2016-11-19T19:53:19Z","updated_at":"2016-11-19T19:53:19Z","body":"you're welcome\r\nyou only have to install the plugin once.\r\nI'll see if I can update the Readme to make the example more clear"}}
{"actor":{"display_login":"posva"}}