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({
}) })
}); });
export const store = createStore( let middleware = [
reducers,
applyMiddleware(
thunkMiddleware, thunkMiddleware,
promiseMiddleware, promiseMiddleware,
loggerMiddleware ];
)
if (process.env.NODE_ENV !== 'production') {
middleware.push(createLogger());
}
export const store = createStore(
reducers,
applyMiddleware(...middleware)
); );
export const persistor = persistStore(store); export const persistor = persistStore(store);

Loading…
Cancel
Save