Skip to content

Instantly share code, notes, and snippets.

@techwizzdom
Last active July 9, 2021 10:24
Show Gist options
  • Save techwizzdom/9ee23b851a33943d9e8383534a0d5329 to your computer and use it in GitHub Desktop.
Save techwizzdom/9ee23b851a33943d9e8383534a0d5329 to your computer and use it in GitHub Desktop.
// userModule.js
export const SET_USER = 'SET_USER'
export const SET_USER_LOCATION = 'SET_USER_LOCATION'
const userModule = {
namespaced: true,
state: () => ({}),
mutations: {},
actions: {
[SET_USER]() {},
[SET_USER_LOCATION]() {}
},
getters: {}
}
// vue file
import { mapActions } from 'vuex'
import { SET_USER, SET_USER_LOCATION } from './userModule.js'
...mapActions({
setUser: SET_USER,
setUserLocation: SET_USER_LOCATION
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment