4

I'm trying to figure out how to comment it correctly using JSDoc3.

/**
 * Module ...
 *
 * @module Cookie
 * @returns {{create, get, remove}}
 */
const cookie = (function () {

    /**
     * Function to create cookie.
     *
     * @param {String} name - The cookie name.
     * @param {String} value - The cookie value.
     * @param {Boolean} elongate - The flag to extend cookie lifetime.
     */
    const create = (name, value, elongate) => {
    ...
    };

    /**
     * Function to get cookie.
     *
     * @param {String} key - The cookie identificatior to get.
     * @returns {*}
     */
    const get = (key) => {
    ...
    };

    /**
     * Function to remove cookie.
     *
     * @param {String} key - The cookie identificator to remove.
     */
    const remove = (key) => {
    ...
    };

    return {
        create: create,
        get: get,
        remove: remove
    }
})();

I'm doing it this way, but generated document looks terrible. I can not rewrite this part of the code to the ES6 standard. Can you please advice?

1
  • 2
    Would love to know as well, seems like everything inside de IIFE is ignored Commented Mar 9, 2018 at 10:43

1 Answer 1

3

After some trying ai found @memberof

You can use it like this:

@memberof module:YourModuleName

Do not know, if it is correct, but after that I saw that method is showed in my module doc. page.

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.