Created
October 25, 2016 13:40
-
-
Save jsumners/0c3ed95154a187fe6ee7496b7cb324ef to your computer and use it in GitHub Desktop.
jsdoc-to-markdown documenting a factory function that returns an object literal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @module foo | |
*/ | |
/** | |
* Describe initialization | |
* @param {object} someInnerGlobal A context | |
* @return {fooFactory} | |
* @alias init | |
*/ | |
module.exports = function init (someInnerGlobal) { | |
const innerGlobal = configureInnerGlobal(someInnerGlobal) | |
/** | |
* Build and return a new `foo` instance. | |
* | |
* @param {object} config Configuration context | |
* @return {fooType} | |
*/ | |
function factory (config) { | |
/** | |
* The real object of the module. | |
* @alias fooType | |
*/ | |
const foo = {} | |
/** | |
* Some method. | |
* @return {*} The result | |
* | |
* @memberof fooType | |
* @method method | |
* @static | |
*/ | |
foo.method = function () {} | |
/** | |
* Another method | |
* @return {*} The result | |
* | |
* @memberof fooType | |
* @method anotherMethod | |
* @static | |
*/ | |
foo.anotherMethod = function () {} | |
} | |
return factory | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment