From 91c78ecd6805646a6e97927a022a65576fb36c07 Mon Sep 17 00:00:00 2001 From: James Lyne Date: Mon, 23 Nov 2020 16:16:26 +0000 Subject: [PATCH] Split store into smaller files --- src/App.vue | 5 +- src/components/WorldListItem.vue | 3 +- src/store/action-types.ts | 4 + src/store/actions.ts | 58 ++++++ src/store/getters.ts | 10 ++ src/store/index.ts | 292 +------------------------------ src/store/mutation-types.ts | 13 ++ src/store/mutations.ts | 131 ++++++++++++++ src/store/state.ts | 70 ++++++++ 9 files changed, 297 insertions(+), 289 deletions(-) create mode 100644 src/store/action-types.ts create mode 100644 src/store/actions.ts create mode 100644 src/store/getters.ts create mode 100644 src/store/mutation-types.ts create mode 100644 src/store/mutations.ts create mode 100644 src/store/state.ts diff --git a/src/App.vue b/src/App.vue index 6f4dec4..1c4de4d 100644 --- a/src/App.vue +++ b/src/App.vue @@ -7,7 +7,8 @@ import {defineComponent, computed, ref} from 'vue'; import Leaflet from './components/Leaflet.vue'; import Sidebar from './components/Sidebar.vue'; -import {ActionTypes, useStore} from "./store"; +import {useStore} from "./store"; +import {ActionTypes} from "@/store/action-types"; export default defineComponent({ name: 'WorldList', @@ -40,7 +41,7 @@ export default defineComponent({ methods: { loadConfiguration() { - useStore().dispatch(ActionTypes.LOAD_CONFIGRUATION, undefined).then(() => { + useStore().dispatch(ActionTypes.LOAD_CONFIGURATION, undefined).then(() => { this.startUpdates(); }); }, diff --git a/src/components/WorldListItem.vue b/src/components/WorldListItem.vue index af34bdb..fe44608 100644 --- a/src/components/WorldListItem.vue +++ b/src/components/WorldListItem.vue @@ -10,9 +10,10 @@