1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-24 02:58:09 +01:00
metamask-extension/ui/app/store.js

22 lines
670 B
JavaScript
Raw Normal View History

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({
2016-08-12 04:04:50 +02:00
predicate: () => global.METAMASK_DEBUG,
})
const middlewares = [thunkMiddleware, loggerMiddleware]
2016-08-11 23:22:48 +02:00
const createStoreWithMiddleware = applyMiddleware(...middlewares)(createStore)
2016-06-21 22:18:32 +02:00
function configureStore (initialState) {
return createStoreWithMiddleware(rootReducer, initialState)
}