From 25e6af91c8d1dfd089391ba83994d37eda988038 Mon Sep 17 00:00:00 2001 From: Joe Wroten Date: Sun, 7 May 2017 20:58:36 -0400 Subject: [PATCH] Proper dispatch events, error handling --- src/components/Index.vue | 37 ++++++++++++++++++++++++------------- src/store.js | 13 +++++++++++++ 2 files changed, 37 insertions(+), 13 deletions(-) diff --git a/src/components/Index.vue b/src/components/Index.vue index effad43..e355fb5 100644 --- a/src/components/Index.vue +++ b/src/components/Index.vue @@ -13,9 +13,9 @@ diff --git a/src/store.js b/src/store.js index 0553049..81c3ac3 100644 --- a/src/store.js +++ b/src/store.js @@ -4,3 +4,16 @@ export let state = { data: [] } } + +export function dispatch (action) { + switch (action.type) { + case 'SPELLS_RESOLVED': + state.spells = action.data + break + } +} + +export default { + state, + dispatch +}