Im trying to use Js docs to generate a static documentation of my project but i got a lot of parse errors when i try to run the js doc command, occurs only where I have curried function, my code works normaly the error are only on js docs, its a lib error or did i do something wrong ?
/**Responsible for fetch the data that will be loaded in the graph within the dialog
*
* @param {function} dispatch redux dispatch function
* @param {String} timeMode time mode used on metric page Example: 'Mensal'
* @param {String} dialogType type of the dialog used to request de correct data and render the body Example: 'WARN_NETWORK_DRIVE'
* @returns {(timeMode: String) => (dialogType: String) => Promise<void>}
*/
export const fetchGraphicData = dispatch => timeMode => async dialogType => {...function logic }
error:
I don't think you can document arguments for a returned function from the function that receives it.. you'd have to split out the documentation like:
/**
* @param {String} dialogType type of the dialog used to request de correct data and render the body Example: 'WARN_NETWORK_DRIVE'
*/
const dialogFn = async dialogType => { };
/**
* @param {String} timeMode time mode used on metric page Example: 'Mensal'
*/
const timeModeFn = timeMode => dialogFn;
/**
* Responsible for fetch the data that will be loaded in the graph within the dialog
*
* @param {function} dispatch redux dispatch function
* @returns {timeModeFn} timeModeFn
*/
export const fetchGraphicData = dispatch => timeModeFn;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With