How can I go from this:
var abc = (function(){
..
})();
register(abc);
to this: (without calling the register outside the class):
function register(object){ stores the object }
var abc = (function(){
..
register(this);
})();
Some background.
The master class has an array object of plugins, the "register" function places the plugin. abc will be such a plugin. plugins following module closure. I would like to put the plugin instances on the list, and the plugin will be as confident as possible. Additional features outside the plugin that I would like to remove.
I thought: MasterClass.plugins.abc = (function ..) but I think it creates a dependency on MasterClass.plugins to create an instance before loading any plugins.
source
share