Function register

  • Register a plugin.

    Parameters

    • plugin: BasePlugin

      Plugin object to instantiate and register

    • Optionalname: string = ...

      a unique name for this plugin

    • Rest...args: any

      all extra parameters will be passed to the plugin constructor

    Returns void

    register

    plugin

    // 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 ();