我有我们组件的reducer,我们正在关注jsDoc文档。但是在reducer中如何在文档中覆盖reducer的redu case。我现在的代码和注释是这样的: -
// first import the constant
import {
REQUEST_DATA,
RECEIVE_DATA,
} from '../constants/dataType';
// define the initial state for the reducer
const initialState = {
dataList: [],
loadingData: false,
};
/**
* It will receive all the data use for the device
* @function : dataReducer
* @param {object} state:contain initial and final state of data
* @param {object} action:return the action object
*/
function dataReducer(state = initialState, action) {
switch (action.type) {
/**
* Action Creator - requestData
* This action is use to call the service to get the device info list
*/
case REQUEST_DATA:
return Object.assign({}, state, {
loadingData: action.loadingData,
});
/**
* Action Creator - receiveData
* it will receive the data dispatching from the requestDevice
*/
case RECEIVE_DATA:
return Object.assign({}, state, {
dataList: action.dataList,
loadingDevice: action.loadingData,
});
}
default:
return state;
}
}
export default dataReducer;
现在,如果我们将转到从jsdoc生成的文档,它将只显示dataReducer,无论我们在函数声明上面写了什么,但是切换情况如何,我认为我们应该在文档中介绍这一部分。我们如何在jsDoc中覆盖减速器的开关盒?