diff options
Diffstat (limited to 'old-ui/app/store.js')
-rw-r--r-- | old-ui/app/store.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/old-ui/app/store.js b/old-ui/app/store.js new file mode 100644 index 000000000..3bafdee11 --- /dev/null +++ b/old-ui/app/store.js @@ -0,0 +1,21 @@ +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) +} |