mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-27 04:46:10 +01:00
22 lines
670 B
JavaScript
22 lines
670 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 = 'GULP_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)
|
|
}
|