From af6ad8ababfe11b0a4daa2bd47d1ce87c71d3be3 Mon Sep 17 00:00:00 2001 From: Guillaume Vincent Date: Fri, 27 Jan 2017 17:58:38 +0100 Subject: [PATCH] extract getter out of store.js file --- src/store.js | 10 +--------- src/store/getters.js | 6 ++++++ 2 files changed, 7 insertions(+), 9 deletions(-) create mode 100644 src/store/getters.js diff --git a/src/store.js b/src/store.js index 83513e6..9b5463a 100644 --- a/src/store.js +++ b/src/store.js @@ -4,6 +4,7 @@ import Auth from './api/auth'; import HTTP from './api/http'; import Storage from './api/storage'; import Password from './domain/password'; +import * as getters from './store/getters'; Vue.use(Vuex); @@ -140,15 +141,6 @@ const actions = { } }; -const getters = { - passwords: state => state.passwords, - password: state => state.password, - isAuthenticated: state => state.authenticated, - isGuest: state => !state.authenticated, - passwordStatus: state => state.passwordStatus, - version: state => state.version, -}; - export default new Vuex.Store({ state: Object.assign(state, storage.json()), getters, diff --git a/src/store/getters.js b/src/store/getters.js new file mode 100644 index 0000000..04b8906 --- /dev/null +++ b/src/store/getters.js @@ -0,0 +1,6 @@ +export const passwords = state => state.passwords; +export const password = state => state.password; +export const isAuthenticated = state => state.authenticated; +export const isGuest = state => !state.authenticated; +export const passwordStatus = state => state.passwordStatus; +export const version = state => state.version;