2016-07-01 03:22:16 +02:00
|
|
|
const createStore = require('redux').createStore
|
|
|
|
const applyMiddleware = require('redux').applyMiddleware
|
2017-09-05 17:58:01 +02:00
|
|
|
const thunkMiddleware = require('redux-thunk').default
|
|
|
|
const createLogger = require('redux-logger').createLogger
|
2016-07-01 03:22:16 +02:00
|
|
|
const rootReducer = require('../ui/app/reducers')
|
|
|
|
|
|
|
|
module.exports = configureStore
|
|
|
|
|
|
|
|
const loggerMiddleware = createLogger()
|
|
|
|
|
|
|
|
const createStoreWithMiddleware = applyMiddleware(
|
|
|
|
thunkMiddleware,
|
|
|
|
loggerMiddleware
|
|
|
|
)(createStore)
|
|
|
|
|
|
|
|
function configureStore (initialState) {
|
|
|
|
return createStoreWithMiddleware(rootReducer, initialState)
|
|
|
|
}
|