aboutsummaryrefslogblamecommitdiffstats
path: root/ui/app/store.js
blob: 8800ca1ad3d1c4ae8d3b4f4f01ee174cc871dfa0 (plain) (tree)
1
2
3
4
5
6
7
8
9
10


                                                        
                                         
                                            
 

                             

                               


                                                       
 
                                                       
 
                                                                              
 
                                        

                                                             
const createStore = require('redux').createStore
const applyMiddleware = require('redux').applyMiddleware
const thunkMiddleware = require('redux-thunk')
const rootReducer = require('./reducers')
const createLogger = require('redux-logger')

global.METAMASK_DEBUG = false

module.exports = configureStore

const loggerMiddleware = createLogger({
  predicate: () => global.METAMASK_DEBUG ? true : false
})

const middlewares = [thunkMiddleware, loggerMiddleware]

const createStoreWithMiddleware = applyMiddleware(...middlewares)(createStore)

function configureStore (initialState) {
  return createStoreWithMiddleware(rootReducer, initialState)
}