0

I'm trying to get namespacing to work with the revealing module pattern. I have code that looks similar to the following:

/**
* @namespace bigpage
*/
var bigpage = {};

/**
* @namespace bigpage.data.methods
* @memberOf bigpage.data
*/

bigpage.data.methods = bigpage.data.methods || (function() {
    /**
    * @function
    * @memberOf bigpage.data.methods
    * @param {string} 
    */
    function getDataSeller(method) {
    }
    return { getDataSeller : getDataSeller };
 })();

However, JSdoc doesn't seeing to pick up the getDataSeller documentation. If someone could give me a way of doing this as well as a reason why the above isn't working, that'd be great.

Ryder Bergerud
  • 733
  • 1
  • 6
  • 15

1 Answers1

1

I found this link to be very helpful: http://devnull.absolventa.de/2014/03/25/jsdoc-and-the-revealing-module-pattern/

// In file: namespace.js
(function() {
    window.Absolventa = window.Absolventa || {};
}());

// In file: modules/urlify.js
(function() {
    "use strict";
    Absolventa.Urlify = (function() {
        var init;

        /**
         * @param {string} foo
         */
        init = function(foo) {
          // Magick!
        };

        return {
          init : init
        };
    }());
}());

So far, we've see some preliminary success. I have yet to fully implement it across all of our code, but I've used it on our most nested code and it seems to be working (using JSDoc3)

Jboyo
  • 96
  • 7
  • Whilst this may theoretically answer the question, [it would be preferable](//meta.stackoverflow.com/q/8259) to include the essential parts of the answer here, and provide the link for reference. – Tunaki Feb 10 '16 at 09:05