Skip to content

Commit

Permalink
chore(client): comment out some unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlougheed committed Jan 8, 2024
1 parent 5ccc2a7 commit f5f8818
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 45 deletions.
5 changes: 2 additions & 3 deletions client/src/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ export const datasets = createFetchActions(k.DATASETS);
// Dataset-specific fetch actions
export const assays = createFetchActions(k.ASSAYS);
export const samples = createFetchActions(k.SAMPLES);
export const chroms = createFetchActions(k.CHROMS);
// export const chroms = createFetchActions(k.CHROMS);
export const positions = createFetchActions(k.POSITIONS);
export const values = createFetchActions(k.VALUES);
export const peaks = createFetchActions(k.PEAKS);
export const dataset = createFetchActions(k.DATASET);
// export const dataset = createFetchActions(k.DATASET);
export const overviewConfig = createFetchActions(k.OVERVIEW_CONFIG);
export const manhattanData = createFetchActions(k.MANHATTAN_DATA);
export const user = createFetchActions(k.USER);
Expand All @@ -35,7 +35,6 @@ export const fetchAssays = createFetchFunction(api.fetchAssays,
export const fetchPositions = createFetchFunction(api.fetchPositions, positions);
// export const cacheValues = createFetchFunction(api.cacheValues, values);
export const fetchPeaks = createFetchFunction(api.fetchPeaks, peaks);
export const fetchDataset = createFetchFunction(api.fetchDataset, dataset);
export const fetchDatasets = createFetchFunction(api.fetchDatasets, datasets);
export const fetchOverviewConfig = createFetchFunction(api.fetchOverviewConfig, overviewConfig);
export const fetchManhattanData = createFetchFunction(api.fetchManhattanData, manhattanData);
Expand Down
4 changes: 2 additions & 2 deletions client/src/constants/ActionTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ export const SET_DEV_MODE = 'SET_DEV_MODE';
export const HANDLE_ERROR = 'HANDLE_ERROR';

export const ASSAYS = createFetchConstants('ASSAYS');
export const DATASET = createFetchConstants('DATASET');
// export const DATASET = createFetchConstants('DATASET');
export const DATASETS = createFetchConstants('DATASETS');
export const SAMPLES = createFetchConstants('SAMPLES');
export const CHROMS = createFetchConstants('CHROMS');
// export const CHROMS = createFetchConstants('CHROMS');
export const POSITIONS = createFetchConstants('POSITIONS');
export const VALUES = createFetchConstants('VALUES');
export const PEAKS = createFetchConstants('PEAKS');
Expand Down
80 changes: 40 additions & 40 deletions client/src/reducers.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ const defaultAssays = makeDefaultListState(
);
const assaysReducer = makeListReducer(k.ASSAYS, defaultAssays);

const defaultDataset = makeDefaultDataState();
// const defaultDataset = makeDefaultDataState();
const defaultDatasets = {
datasetsByNode: {},
isLoading: false,
Expand All @@ -170,45 +170,45 @@ const datasetsReducer = (state = defaultDatasets, action) => {
}

// Single-dataset handling
case k.DATASET.REQUEST: {
const {datasetsByNode} = state;
const {node} = action.meta;
return {
...state,
datasetsByNode: {
...datasetsByNode,
[node]: {...defaultDataset, ...(datasetsByNode[node] ?? {}), isLoading: true},
},
};
}
case k.DATASET.RECEIVE: {
const {datasetsByNode} = state;
const {node} = action.meta;
return {
...state,
datasetsByNode: {
...datasetsByNode,
[node]: {
...defaultDataset,
...(datasetsByNode[node] ?? {}),
isLoading: false,
isLoaded: true,
data: action.payload,
},
},
};
}
case k.DATASET.ERROR: {
const {datasetsByNode} = state;
const {node} = action.meta;
return {
...state,
datasetsByNode: {
...datasetsByNode,
[node]: {...defaultDataset, ...(datasetsByNode[node] ?? {}), isLoading: false},
},
};
}
// case k.DATASET.REQUEST: {
// const {datasetsByNode} = state;
// const {node} = action.meta;
// return {
// ...state,
// datasetsByNode: {
// ...datasetsByNode,
// [node]: {...defaultDataset, ...(datasetsByNode[node] ?? {}), isLoading: true},
// },
// };
// }
// case k.DATASET.RECEIVE: {
// const {datasetsByNode} = state;
// const {node} = action.meta;
// return {
// ...state,
// datasetsByNode: {
// ...datasetsByNode,
// [node]: {
// ...defaultDataset,
// ...(datasetsByNode[node] ?? {}),
// isLoading: false,
// isLoaded: true,
// data: action.payload,
// },
// },
// };
// }
// case k.DATASET.ERROR: {
// const {datasetsByNode} = state;
// const {node} = action.meta;
// return {
// ...state,
// datasetsByNode: {
// ...datasetsByNode,
// [node]: {...defaultDataset, ...(datasetsByNode[node] ?? {}), isLoading: false},
// },
// };
// }

default:
return state;
Expand Down

0 comments on commit f5f8818

Please sign in to comment.