From f5f8818030682ab60dd8eea641c7c329d9e5ef89 Mon Sep 17 00:00:00 2001 From: David Lougheed Date: Mon, 8 Jan 2024 16:54:13 -0500 Subject: [PATCH] chore(client): comment out some unused code --- client/src/actions.js | 5 +- client/src/constants/ActionTypes.js | 4 +- client/src/reducers.js | 80 ++++++++++++++--------------- 3 files changed, 44 insertions(+), 45 deletions(-) diff --git a/client/src/actions.js b/client/src/actions.js index c4037e75..93c7b177 100644 --- a/client/src/actions.js +++ b/client/src/actions.js @@ -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); @@ -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); diff --git a/client/src/constants/ActionTypes.js b/client/src/constants/ActionTypes.js index 0efcfaf0..51ca7ef3 100644 --- a/client/src/constants/ActionTypes.js +++ b/client/src/constants/ActionTypes.js @@ -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'); diff --git a/client/src/reducers.js b/client/src/reducers.js index c48458c8..0b5c89c6 100644 --- a/client/src/reducers.js +++ b/client/src/reducers.js @@ -145,7 +145,7 @@ const defaultAssays = makeDefaultListState( ); const assaysReducer = makeListReducer(k.ASSAYS, defaultAssays); -const defaultDataset = makeDefaultDataState(); +// const defaultDataset = makeDefaultDataState(); const defaultDatasets = { datasetsByNode: {}, isLoading: false, @@ -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;