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.
22 lines
673 B
22 lines
673 B
9 years ago
|
const createStore = require('redux').createStore
|
||
|
const applyMiddleware = require('redux').applyMiddleware
|
||
7 years ago
|
const thunkMiddleware = require('redux-thunk').default
|
||
6 years ago
|
const rootReducer = require('../ducks')
|
||
7 years ago
|
const createLogger = require('redux-logger').createLogger
|
||
9 years ago
|
|
||
7 years ago
|
global.METAMASK_DEBUG = process.env.METAMASK_DEBUG
|
||
8 years ago
|
|
||
9 years ago
|
module.exports = configureStore
|
||
|
|
||
8 years ago
|
const loggerMiddleware = createLogger({
|
||
8 years ago
|
predicate: () => global.METAMASK_DEBUG,
|
||
8 years ago
|
})
|
||
9 years ago
|
|
||
8 years ago
|
const middlewares = [thunkMiddleware, loggerMiddleware]
|
||
8 years ago
|
|
||
8 years ago
|
const createStoreWithMiddleware = applyMiddleware(...middlewares)(createStore)
|
||
9 years ago
|
|
||
8 years ago
|
function configureStore (initialState) {
|
||
9 years ago
|
return createStoreWithMiddleware(rootReducer, initialState)
|
||
|
}
|