mirror of
https://github.com/yldio/copilot.git
synced 2024-12-29 05:10:05 +02:00
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 middleware = isProduction() ?
|
||||
applyMiddleware(
|
||||
createLogger(),
|
||||
promiseMiddleware(),
|
||||
thunk
|
||||
) :
|
||||
applyMiddleware(
|
||||
createLogger(),
|
||||
promiseMiddleware(),
|
||||
thunk,
|
||||
perflogger
|
||||
);
|
||||
|
||||
export default (state = Object.freeze({})) => {
|
||||
return createStore(
|
||||
enableBatching(createReducer()),
|
||||
state,
|
||||
composeEnhancers(
|
||||
applyMiddleware(
|
||||
createLogger(),
|
||||
promiseMiddleware(),
|
||||
thunk/*,
|
||||
!isProduction() && perflogger*/
|
||||
)
|
||||
)
|
||||
composeEnhancers(middleware)
|
||||
);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user