Below is my code structure:
const kind = [];
kind.sample= factory( function() {
const sample = {};
sample.init = function() {...}
const privateFunction = function() {...}
return sample;
} );
function factory( protoFn )
{
return () => Object.create( protoFn() );
}
kind.sample();
And this is how I have tried to document it so far:
/**
* @namespace kind
* @description keeps references of objects' factory functions.
*/
const kind = [];
/**
* @description define prototype function
* @method
*/
kind.sample= factory( function() {
/**
* @namespace kind.sample <- does not work
* @description prototype
*/
const sample = {};
/**
* @memberof kind.sample
*/
sample.init = function() {...}
/**
* @private
*/
const privateFunction = function() {...}
return sample;
} );
function factory( protoFn )
{
return () => Object.create( protoFn() );
}
kind.sample();
As you can see above, I want to create a sample
namespace under kind
namespace. JSDoc generates it under kind
namespace but when I click on it, nothing happens and I cannot see the methods( like init
). However if I create it as a separate namespace e.g sample
, it works fine. Could you tell me how can I put sample
namespace as a nested namespace under kind
?