Create PluginInvokeSupport
The plugin manager to associate.
Returns whether the associated plugin manager has been destroyed.
Returns whether the plugin manager has been destroyed.
Returns the associated plugin manager options.
The associated plugin manager options.
Gets the associated plugin manager.
The associated plugin manager
Returns method names for a specific plugin, list of plugins, or all plugins. The enabled state can be specified along with sorting methods by plugin name.
Optional
opts: { Options object. If undefined all plugin data is returned.
Optional
enabled?: booleanIf enabled is a boolean it will return plugin methods names given the respective enabled state.
Optional
plugins?: string | Iterable<string>Plugin name or iterable list of names.
A list of method names
This dispatch method simply invokes any plugin targets for the given method name.
Options object.
Optional
args?: any[]Method arguments. This array will be spread as multiple arguments.
Method name to invoke.
Optional
plugins?: string | Iterable<string>Specific plugin name or iterable list of plugin names to invoke.
This dispatch method is asynchronous and adds any returned results to an array which is resolved via Promise.all Any target invoked may return a Promise or any result.
Options object.
Optional
args?: any[]Method arguments. This array will be spread as multiple arguments.
Method name to invoke.
Optional
plugins?: string | Iterable<string>Specific plugin name or iterable list of plugin names to invoke.
A single result or array of results.
This dispatch method synchronously passes to and returns from any invoked targets a PluginEvent.
Options object.
Optional
copyProperties that are copied.
Method name to invoke.
Optional
passthruProperties that are passed through.
Optional
plugins?: string | Iterable<string>Specific plugin name or iterable list of plugin names to invoke.
The PluginEvent data.
This dispatch method synchronously passes back a single value or an array with all results returned by any invoked targets.
Options object.
Optional
args?: any[]Method arguments. This array will be spread as multiple arguments.
Method name to invoke.
Optional
plugins?: string | Iterable<string>Specific plugin name or iterable list of plugin names to invoke.
A single result or array of results.
This dispatch method synchronously passes to and returns from any invoked targets a PluginEvent.
Options object.
Optional
copyProperties that are copied.
Method name to invoke.
Optional
passthruProperties that are passed through.
Optional
plugins?: string | Iterable<string>Specific plugin name or iterable list of plugin names to invoke.
The PluginEvent data.
Sets the eventbus associated with this plugin manager. If any previous eventbus was associated all plugin manager
events will be removed then added to the new eventbus. If there are any existing plugins being managed their
events will be removed from the old eventbus and then onPluginLoad
will be called with the new eventbus.
Set optional parameters.
Defines optional parameters to set.
PluginInvokeSupport adds direct method invocation support to PluginManager via the eventbus and alternately through a wrapped instance of PluginManager depending on the use case.
There are two types of invocation methods the first spreads an array of arguments to the invoked method. The second constructs a PluginInvokeEvent to pass to the method with a single parameter.
TODO: more info and wiki link
When added to a PluginManager through constructor initialization the following events are registered on the plugin manager eventbus:
plugins:async:invoke
- PluginInvokeSupport#invokeAsyncplugins:async:invoke:event
- PluginInvokeSupport#invokeAsyncEventplugins:get:method:names
- PluginInvokeSupport#getMethodNamesplugins:has:method
- PluginInvokeSupport#hasMethodplugins:invoke
- PluginInvokeSupport#invokeplugins:sync:invoke
- PluginInvokeSupport#invokeSyncplugins:sync:invoke:event
- PluginInvokeSupport#invokeSyncEventExample