4

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: enter image description here

1 Answer 1

4

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;
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.