blob: 9f12f469e2a9428bda3a1c238f3cad8ea7e30c80 (
plain) (
tree)
|
|
const createStore = require('redux').createStore
const applyMiddleware = require('redux').applyMiddleware
const thunkMiddleware = require('redux-thunk').default
const rootReducer = require('../ducks')
const createLogger = require('redux-logger').createLogger
global.METAMASK_DEBUG = process.env.METAMASK_DEBUG
module.exports = configureStore
const loggerMiddleware = createLogger({
predicate: () => global.METAMASK_DEBUG,
})
const middlewares = [thunkMiddleware, loggerMiddleware]
const createStoreWithMiddleware = applyMiddleware(...middlewares)(createStore)
function configureStore (initialState) {
return createStoreWithMiddleware(rootReducer, initialState)
}
|