Disable logger middleware in production builds.

master
Tom Hacohen 7 years ago
parent 22381a1f85
commit 6566bc01df

@ -9,8 +9,6 @@ import promiseMiddleware from './promise-middleware';
import * as EteSync from './api/EteSync'; import * as EteSync from './api/EteSync';
const loggerMiddleware = createLogger();
export interface FetchType<T> { export interface FetchType<T> {
value: T | null; value: T | null;
fetching?: boolean; fetching?: boolean;
@ -175,13 +173,18 @@ const reducers = combineReducers({
}) })
}); });
let middleware = [
thunkMiddleware,
promiseMiddleware,
];
if (process.env.NODE_ENV !== 'production') {
middleware.push(createLogger());
}
export const store = createStore( export const store = createStore(
reducers, reducers,
applyMiddleware( applyMiddleware(...middleware)
thunkMiddleware,
promiseMiddleware,
loggerMiddleware
)
); );
export const persistor = persistStore(store); export const persistor = persistStore(store);

Loading…
Cancel
Save