Refactor perflogger code

This commit is contained in:
JUDIT GRESKOVITS 2017-04-06 12:57:19 +01:00
parent 4f1ca25ce9
commit 587889e4b0

View File

@ -10,17 +10,23 @@ import { isProduction } from '@utils';
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose; const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
const middleware = isProduction() ?
applyMiddleware(
createLogger(),
promiseMiddleware(),
thunk
) :
applyMiddleware(
createLogger(),
promiseMiddleware(),
thunk,
perflogger
);
export default (state = Object.freeze({})) => { export default (state = Object.freeze({})) => {
return createStore( return createStore(
enableBatching(createReducer()), enableBatching(createReducer()),
state, state,
composeEnhancers( composeEnhancers(middleware)
applyMiddleware(
createLogger(),
promiseMiddleware(),
thunk/*,
!isProduction() && perflogger*/
)
)
); );
}; };