👂Plugin entrypoint

gnarpy from regretevator cutting a xan cake
src/index.ts
import { General } from "@vendetta/ui/components";

const { Text } = General;

export const onLoad = () => console.log("Plugin loaded!");
export const onUnload = () => console.log("Plugin loaded!");
export const Settings = () => <Text style={{ color: "#000" }}>Hello!</Text>;
  • onLoad — A function that gets called when the plugin gets enabled

  • onUnload — A function that gets called when the plugin gets disabled

  • Settings — A React JSX component, serves as the settings for the plugin

A plugin only gets ran when the user enables it. So this piece of code:

src/index.ts
console.log("Plugin loaded!");
export const onUnload = () => console.log("Plugin loaded!");

does the same thing as this piece of code:

src/index.ts
export const onLoad = () => console.log("Plugin loaded!");
export const onUnload = () => console.log("Plugin loaded!");

However it's recommended to keep your initial code in onLoad, incase this changes in the future

Last updated

Was this helpful?