Agent
Last updated
Was this helpful?
Last updated
Was this helpful?
The Agent class is NOT a React Component.
Therefore none of the is available.
The Agent is a js class, think about it like the brain of your plugin, the main component to communicate and do requests and talk to the outer world.
Agent can communicate with other components in your plugin or other plugin's Agent or component with the "plugin events dispatcher"
The plugin Agent will be initiated and initialized once the plugin register it self.
Agent will always be up and running as long as your plugin is installed and active in Dashboard.
Agent will only be turned "off" when the plugin is uninstalled or deactivated.
Once the plugin is deactivated or Dashboard window closed, Dashboard will try to call the close()
function if there is one provided in the Agent.
You can build your Agent component by extending the Agent base from Plugin-API
Dashboard will pass custom props to your Agent including the config of your plugin to be used inside your Agent
In your main index.js
file where you register your plugin, import your Agent and pass it down with the register() method from Plugin-API
Function that is called before agent is unregistered.