1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00
metamask-extension/ui/app/store.js

22 lines
649 B
JavaScript
Raw Normal View History

const createStore = require('redux').createStore
const applyMiddleware = require('redux').applyMiddleware
const thunkMiddleware = require('redux-thunk')
const rootReducer = require('./reducers')
2016-08-11 23:20:26 +02:00
const createLogger = require('redux-logger')
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)
}