diff options
Diffstat (limited to 'ui/app/store.js')
-rw-r--r-- | ui/app/store.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/ui/app/store.js b/ui/app/store.js new file mode 100644 index 000000000..a738f1a12 --- /dev/null +++ b/ui/app/store.js @@ -0,0 +1,19 @@ +const createStore = require('redux').createStore +const applyMiddleware = require('redux').applyMiddleware +const thunkMiddleware = require('redux-thunk') +const createLogger = require('redux-logger') +const rootReducer = require('./reducers') + +module.exports = configureStore + + +const loggerMiddleware = createLogger() + +const createStoreWithMiddleware = applyMiddleware( + thunkMiddleware, + loggerMiddleware +)(createStore) + +function configureStore(initialState) { + return createStoreWithMiddleware(rootReducer, initialState) +} |