Refactor perflogger code
This commit is contained in:
parent
4f1ca25ce9
commit
587889e4b0
@ -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*/
|
|
||||||
)
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user