Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide examples of using JSDoc with code wrapped in IIFEs #41

Open
hegemonic opened this issue Aug 6, 2013 · 2 comments
Open

Provide examples of using JSDoc with code wrapped in IIFEs #41

hegemonic opened this issue Aug 6, 2013 · 2 comments

Comments

@hegemonic
Copy link
Contributor

We should provide some non-module examples that show how to use JSDoc with code wrapped in IIFEs. See jsdoc/jsdoc#456 for more context.

@hegemonic hegemonic added this to the 3.4.0 milestone Dec 28, 2014
@hegemonic hegemonic removed this from the 3.4.0 milestone Nov 11, 2015
@Haroenv
Copy link

Haroenv commented Dec 5, 2015

So what is the workaround now to let jsdoc generate documentation if you encapsulate your function?

I'm encapsulating my function like this:

(function() {
  // some code with functions and documentation
})();

Which generates output if I leave out the encapsulation.

@garapa
Copy link

garapa commented Apr 18, 2017

I've found out that you may use annotations on IIFE's (@Class or @method for example) to generate the docs.

Something like this:

/**
  * @class className
*/
(function(){
         /**
           * @name #init
           * @function
           * @memberOf className
         */
        function init() {
          
        };
})();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants