Skip to content

Listening For Events

Searchcraft provides a way to perform other actions within your application when various events occur within Searchcraft.

main.ts
const unsubscribeCallback = searchcraft.subscribe('<event name>', (event) => {
// Do something when this event happens
});
// In your cleanup function, call unsubscribe:
unsubscribeCallback();

For a complete reference for all available events, see the Event Reference.