diff options
author | Kevin Serrano <kevgagser@gmail.com> | 2016-08-12 04:59:14 +0800 |
---|---|---|
committer | Kevin Serrano <kevgagser@gmail.com> | 2016-08-12 04:59:14 +0800 |
commit | 9904b4ef5a3d942c97e0585a9f1e4a5ddc7de8e6 (patch) | |
tree | ad4cdf64e43d0804a735470050794ff5a793ca97 /ui/app | |
parent | ffb48028a35e68bf53041cf34e75e7b9acf87aa2 (diff) | |
download | tangerine-wallet-browser-9904b4ef5a3d942c97e0585a9f1e4a5ddc7de8e6.tar tangerine-wallet-browser-9904b4ef5a3d942c97e0585a9f1e4a5ddc7de8e6.tar.gz tangerine-wallet-browser-9904b4ef5a3d942c97e0585a9f1e4a5ddc7de8e6.tar.bz2 tangerine-wallet-browser-9904b4ef5a3d942c97e0585a9f1e4a5ddc7de8e6.tar.lz tangerine-wallet-browser-9904b4ef5a3d942c97e0585a9f1e4a5ddc7de8e6.tar.xz tangerine-wallet-browser-9904b4ef5a3d942c97e0585a9f1e4a5ddc7de8e6.tar.zst tangerine-wallet-browser-9904b4ef5a3d942c97e0585a9f1e4a5ddc7de8e6.zip |
Add ability to hide logging messages in production.
Diffstat (limited to 'ui/app')
-rw-r--r-- | ui/app/store.js | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/ui/app/store.js b/ui/app/store.js index ab6422e73..9a88ef8c9 100644 --- a/ui/app/store.js +++ b/ui/app/store.js @@ -1,18 +1,39 @@ const createStore = require('redux').createStore const applyMiddleware = require('redux').applyMiddleware const thunkMiddleware = require('redux-thunk') -const createLogger = require('redux-logger') const rootReducer = require('./reducers') +const developmentMode = require('../../app/scripts/config').developmentMode module.exports = configureStore -const loggerMiddleware = createLogger() +const middlewares = [thunkMiddleware] -const createStoreWithMiddleware = applyMiddleware( - thunkMiddleware, - loggerMiddleware +console.log(developmentMode) +if (developmentMode) { + console.log("Development Mode ON.") + const createLogger = require('redux-logger') + const loggerMiddleware = createLogger() + middlewares.push(loggerMiddleware) +} else { + console.log("Development Mode OFF.") +} + + +const createStoreWithMiddleware = applyMiddleware(...middlewares )(createStore) function configureStore (initialState) { return createStoreWithMiddleware(rootReducer, initialState) } + +// import thunk from 'redux-thunk'; +// +// const middlewares = [thunk]; +// +// if (process.env.NODE_ENV === `development`) { +// const createLogger = require(`redux-logger`); +// const logger = createLogger(); +// middlewares.push(logger); +// } +// +// const store = compose(applyMiddleware(...middlewares))(createStore)(reducer); |