-
-
Save iparrabb/a96e8eca00090923c4ad89483d38a997 to your computer and use it in GitHub Desktop.
This file contains 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 appModule = { | |
state: initialState(), | |
actions: { | |
addUser ({commit, state}, user) { | |
commit(types.ADD_USER, user) | |
} | |
}, | |
mutations: { | |
[types.ADD_USER] (state, user) { | |
state.users.push(user) | |
} | |
}, | |
getters: { | |
users (state) { | |
return state.users | |
}, | |
usersLenght (state) { | |
return state.users.length | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment