Przeglądaj źródła

extract getter out of store.js file

pull/342/head
Guillaume Vincent 7 lat temu
rodzic
commit
af6ad8abab
2 zmienionych plików z 7 dodań i 9 usunięć
  1. +1
    -9
      src/store.js
  2. +6
    -0
      src/store/getters.js

+ 1
- 9
src/store.js Wyświetl plik

@@ -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,


+ 6
- 0
src/store/getters.js Wyświetl plik

@@ -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;

Ładowanie…
Anuluj
Zapisz