I see a lot of plugins use the JavaScript module pattern, like so:
Unfortunately, if the plugin defines things like custom windows, scenes, or sprites, the definitions are locked up in the anonymous scope in the original plugin, so nobody else can access them.
Is there a standard way to make those definitions available to other plugins without rewriting the whole thing to use a different pattern? I've found workarounds and hacks, but I'd prefer a method that's generally accepted, if one exists.
Code:
(function() {
//plugin code goes here
})();
Is there a standard way to make those definitions available to other plugins without rewriting the whole thing to use a different pattern? I've found workarounds and hacks, but I'd prefer a method that's generally accepted, if one exists.