Skip to content

Commit

Permalink
resolve conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
lixun910 committed Nov 26, 2024
1 parent 9447e2f commit d1036de
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions examples/demo-app/src/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,29 @@ const reducers = combineReducers({
routing: routerReducer
});

// add redux-logger
const loggerMiddleware = createLogger({
predicate: (_getState, action) => {
// skip logging in production mode
if (process.env.NODE_ENV === 'production') {
return false;
}
const skipLogging = [
'@@kepler.gl/LAYER_HOVER',
'@@kepler.gl/MOUSE_MOVE',
'@@kepler.gl/UPDATE_MAP'
];
return !skipLogging.includes(action.type);
},
collapsed: () => true // Collapse all actions for more compact log
});

export const middlewares = enhanceReduxMiddleware([
thunk,
routerMiddleware(browserHistory),
loggerMiddleware
]);

// eslint-disable-next-line no-process-env
if (NODE_ENV === 'local') {
// Redux logger
const logger = createLogger({
collapsed: () => true // Collapse all actions for more compact log
});
middlewares.push(logger);
}

export const enhancers = [applyMiddleware(...middlewares)];

const initialState = {};
Expand Down

0 comments on commit d1036de

Please sign in to comment.