You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
633 B
21 lines
633 B
const createStore = require('redux').createStore
|
|
const applyMiddleware = require('redux').applyMiddleware
|
|
const thunkMiddleware = require('redux-thunk')
|
|
const rootReducer = require('./reducers')
|
|
const createLogger = require('redux-logger')
|
|
|
|
global.METAMASK_DEBUG = false
|
|
|
|
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)
|
|
}
|
|
|