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
|
2019-03-22 00:03:30 +01:00
|
|
|
const rootReducer = require('../ui/app/ducks')
|
2016-07-01 03:22:16 +02:00
|
|
|
|
|
|
|
module.exports = configureStore
|
|
|
|
|
|
|
|
const loggerMiddleware = createLogger()
|
|
|
|
|
|
|
|
const createStoreWithMiddleware = applyMiddleware(
|
|
|
|
thunkMiddleware,
|
|
|
|
loggerMiddleware
|
|
|
|
)(createStore)
|
|
|
|
|
|
|
|
function configureStore (initialState) {
|
|
|
|
return createStoreWithMiddleware(rootReducer, initialState)
|
|
|
|
}
|