aboutsummaryrefslogblamecommitdiffstats
path: root/ui/app/store.js
blob: ab6422e733bb00aa0cc8f8c8825526815a0f73ef (plain) (tree)
1
2
3
4
5
6
7
8







                                                        






                                                  
                                        

                                                             
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)
}