{"action":"closed","issue":{"url":"https://api.github.com/repos/vuejs/vuex/issues/529","repository_url":"https://api.github.com/repos/vuejs/vuex","labels_url":"https://api.github.com/repos/vuejs/vuex/issues/529/labels{/name}","comments_url":"https://api.github.com/repos/vuejs/vuex/issues/529/comments","events_url":"https://api.github.com/repos/vuejs/vuex/issues/529/events","html_url":"https://github.com/vuejs/vuex/issues/529","id":196214083,"number":529,"title":"Is there a simple way to define multiple mutations with the same code","user":{"login":"vedmant","id":5052406,"avatar_url":"https://avatars.githubusercontent.com/u/5052406?v=3","gravatar_id":"","url":"https://api.github.com/users/vedmant","html_url":"https://github.com/vedmant","followers_url":"https://api.github.com/users/vedmant/followers","following_url":"https://api.github.com/users/vedmant/following{/other_user}","gists_url":"https://api.github.com/users/vedmant/gists{/gist_id}","starred_url":"https://api.github.com/users/vedmant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vedmant/subscriptions","organizations_url":"https://api.github.com/users/vedmant/orgs","repos_url":"https://api.github.com/users/vedmant/repos","events_url":"https://api.github.com/users/vedmant/events{/privacy}","received_events_url":"https://api.github.com/users/vedmant/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-12-17T10:03:26Z","updated_at":"2016-12-18T15:53:16Z","closed_at":"2016-12-18T15:53:16Z","body":"Maybe this is a noob question, however I cannot find anything about this in documentation nor google it.\r\n\r\nFor example I want to set loading state to true for all mutations that start async request, all this mutations are handled in modules, however global loading state is kept in different (global) module. With Redux I'd do just something like this:\r\n\r\n    switch (action.type) {\r\n\r\n      case 'LOGIN_STATUS':\r\n      case 'LOGIN':\r\n      case 'LOAD_PHOTOS':\r\n      case 'UPLOAD_PHOTO':\r\n        return merge({}, state, { loading: true });\r\n\r\n      case 'LOGIN_STATUS_OK':\r\n      case 'LOGIN_OK':\r\n      case 'LOAD_PHOTOS_OK':\r\n      case 'UPLOAD_PHOTO_OK':\r\n        return merge({}, state, { loading: false });\r\n\r\n      default: return state;\r\n    }\r\n\r\nHow can this be achieved with Vuex?\r\n\r\nThanks!"}}
{"actor":{"display_login":"ktsn"}}