mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-23 10:30:04 +01:00
22 lines
675 B
JavaScript
22 lines
675 B
JavaScript
const createStore = require('redux').createStore
|
|
const applyMiddleware = require('redux').applyMiddleware
|
|
const thunkMiddleware = require('redux-thunk').default
|
|
const rootReducer = require('./reducers')
|
|
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)
|
|
}
|