Skip to main content

addEventListener

Registers a command to run when an event is triggered.

const { command } = useCommands("pluginName");
addEventListener("eventName", command);

Inkweaver includes event listeners in your novel's saved state, so you don't need to rebind after loading.

See Also