|
|
|
@ -1,17 +1,20 @@ |
|
|
|
|
const createStore = require('redux').createStore |
|
|
|
|
const applyMiddleware = require('redux').applyMiddleware |
|
|
|
|
const thunkMiddleware = require('redux-thunk') |
|
|
|
|
const createLogger = require('redux-logger') |
|
|
|
|
const rootReducer = require('./reducers') |
|
|
|
|
const createLogger = require('redux-logger') |
|
|
|
|
|
|
|
|
|
global.METAMASK_DEBUG = false |
|
|
|
|
|
|
|
|
|
module.exports = configureStore |
|
|
|
|
|
|
|
|
|
const loggerMiddleware = createLogger() |
|
|
|
|
const loggerMiddleware = createLogger({ |
|
|
|
|
predicate: () => global.METAMASK_DEBUG, |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
const middlewares = [thunkMiddleware, loggerMiddleware] |
|
|
|
|
|
|
|
|
|
const createStoreWithMiddleware = applyMiddleware( |
|
|
|
|
thunkMiddleware, |
|
|
|
|
loggerMiddleware |
|
|
|
|
)(createStore) |
|
|
|
|
const createStoreWithMiddleware = applyMiddleware(...middlewares)(createStore) |
|
|
|
|
|
|
|
|
|
function configureStore (initialState) { |
|
|
|
|
return createStoreWithMiddleware(rootReducer, initialState) |
|
|
|
|