0

I have a javascript class which has plugins. These plugins actually add/replace functions of this class. However, I don't see how I should document these plugins. For example, if I have a class and plugin as follows

CLASS:

/** Foo is a .....
    @class Foo
    @constructor
*/
function Foo() { this.add = function(){...} }

PLUGIN:

(function(Foo) {
    Foo.add = function(input){...};
    Foo.bar = function() { ... };
})(Foo);

So, the plugin replaces the 'add' function and adds a new 'bar' function. The problem I have is that this plugin is not a class or sublcass of Foo. Nor is it a module or submodule (I think). Any suggestion what would be best to do in this situation ?

Jeanluca Scaljeri
  • 26,343
  • 56
  • 205
  • 333

0 Answers0