_initPlugins
private
void
_initPlugins
(
config
)
- Parameters:
-
config <Config>
The configuration object with property name/value pairs.
_plug
private
void
_plug
(
PluginClass
,
config
)
- Parameters:
-
PluginClass <Function>
The plugin class to instantiate -
config <Object>
The configuration object for the plugin
_unplug
private
void
_unplug
(
plugin
)
- Parameters:
-
plugin <String | Function>
The namespace for the plugin, or a plugin class with the static NS property defined.
hasPlugin
boolean
hasPlugin
(
ns
)
- Parameters:
-
ns <String>
The plugin's namespace
- Returns:
boolean
- returns true, if the plugin has been plugged into this host, false otherwise.
plug
Base
plug
(
p
,
config
)
- Parameters:
-
p <Function | Object |Array>
Accepts the plugin class, or an object with a "fn" property specifying the plugin class and a "cfg" property specifying the configuration for the Plugin.Additionally an Array can also be passed in, with the above function or object values, allowing the user to add multiple plugins in a single call.
-
config <object>
(Optional) If the first argument is the plugin class, the second argument can be the configuration for the plugin.
- Returns:
Base
- A reference to the host object
Plugin.Host.plug
static
void
Plugin.Host.plug
(
hostClass
,
plugin
,
config
)
- Parameters:
-
hostClass <Function>
The host class on which to register the plugins -
plugin <Function | Array>
Either the plugin class, an array of plugin classes or an array of objects (with fn and cfg properties defined) -
config <Object>
(Optional) If plugin is the plugin class, the configuration for the plugin
Plugin.Host.unplug
static
void
Plugin.Host.unplug
(
hostClass
,
plugin
)
- Parameters:
-
hostClass <Function>
The host class from which to unregister the plugins -
plugin <Function | Array>
The plugin class, or an array of plugin classes
unplug
Base
unplug
(
plugin
)
- Parameters:
-
plugin <String | Function>
The namespace of the plugin, or the plugin class with the static NS namespace property defined. If not provided, all registered plugins are unplugged.
- Returns:
Base
- A reference to the host object