Skip to content

Instantly share code, notes, and snippets.

@techwizzdom
Created July 9, 2021 09:59
Show Gist options
  • Save techwizzdom/545e4bebe4009f655657507fc4cf5e3e to your computer and use it in GitHub Desktop.
Save techwizzdom/545e4bebe4009f655657507fc4cf5e3e to your computer and use it in GitHub Desktop.
const userModule = {
namespaced: true,
state: () => ({}),
mutations: {},
actions: {},
getters: {}
}
const organisationModule = {
namespaced: true,
state: () => ({}),
mutations: {},
actions: {},
}
const store = new VueX.Store({
modules: {
user: userModule,
organisation: organisationModule
}
})
store.state.user // -> `userModule`'s state
store.state.organisation // -> `organisationModule`'s state
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment