-
Notifications
You must be signed in to change notification settings - Fork 0
Unit: Plugin
Jake edited this page Jun 22, 2018
·
2 revisions
Plugins are what define different kinds of interactions that can be performed. These interactions can range anywhere from HTTP requests to Midi signals to state management.
A valid plugin unit conforms to this interface:
interface PluginUnit {
is: 'plugin';
config: {
type: string | string[];
dependencies?: {
plugins?: string[];
services?: string[];
};
[key: string]: any;
};
middleware?: (middleware: Middleware) => void
[key: string]: any;
}
Every plugin has an installation method with the same name as that plugin's type. The install method is where a plugin receives all of the added components. Here is an example:
const plugin = {
is: 'component',
type: 'http',
// here is the installation method
http (component: Component) {
// do something to install the component
}
}