Created
July 9, 2021 09:59
-
-
Save techwizzdom/545e4bebe4009f655657507fc4cf5e3e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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