The registry is module-global, not per-application: a name can only be
registered once for the lifetime of the page.
Note the ordering — the instance is constructed before the base-class and
version checks can run, because both read the instance. A plugin whose
constructor has side effects (event subscriptions, engine patches) will have
applied them by the time Plugin version mismatch throws.
a unique name for this plugin; defaults to the class name
...args: any[]
all extra parameters will be passed to the plugin constructor
Returns void
Example
// register a new plugin me.plugin.register(TestPlugin, "testPlugin"); // the `testPlugin` class instance can also be accessed through me.plugin.cache me.plugin.cache.testPlugin.myfunction ();
Register a plugin.
The registry is module-global, not per-application: a name can only be registered once for the lifetime of the page.
Note the ordering — the instance is constructed before the base-class and version checks can run, because both read the instance. A plugin whose constructor has side effects (event subscriptions, engine patches) will have applied them by the time
Plugin version mismatchthrows.