WebJamApps/JaMmusic

View on GitHub
src/redux/reducers/tableReducer.ts

Summary

Maintainability
A
0 mins
Test Coverage
B
82%
const initialState = {
  showTable: true,
};
// eslint-disable-next-line @typescript-eslint/default-param-last
const reducer = (state = initialState, action: { type: string; showTable: boolean; }): { showTable: boolean } => {
  switch (action.type) {
    case 'SHOW_TABLE':
      return {
        ...state,
        showTable: action.showTable,
      };
    default:
      return state;
  }
};

export default reducer;