From 0220be44661da06664776c44f1a80e1f0562256a Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Sat, 13 May 2017 23:22:37 +0430 Subject: [PATCH] [store] fix condition where root store is not exporting state --- lib/app/store.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/lib/app/store.js b/lib/app/store.js index c4f0ae7afc..54b68a18c4 100644 --- a/lib/app/store.js +++ b/lib/app/store.js @@ -34,13 +34,9 @@ for (let filename of filenames) { // createStore export const createStore = storeData instanceof Function ? storeData : () => { - // Vuex Bug - if (storeData.state instanceof Function) { - return new Vuex.Store(Object.assign({}, storeData, { - state: storeData.state() - })) - } - return new Vuex.Store(storeData) + return new Vuex.Store(Object.assign({}, storeData, { + state: storeData.state instanceof Function ? storeData.state() : {} + })) } // Dynamically require module