Plugin
What the bundle of a plugin exports: a function onload, and optionally onunload. Make it with definePlugin.
Methods
Section titled “Methods”onload()
Section titled “onload()”onload(ctx): void | Promise<void>;The app calls this function once, when the plugin is turned on. Everything that the plugin registers through ctx is removed when the plugin is turned off.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
ctx |
PluginContext |
the object through which the plugin reaches the app |
Returns
Section titled “Returns”void | Promise<void>
onunload()?
Section titled “onunload()?”onunload?(): void | Promise<void>;The app calls this function when the plugin is turned off, just before it removes what the plugin registered through ctx. It is the place to clean up anything that the plugin created without using ctx.
Returns
Section titled “Returns”void | Promise<void>
