alexanderatallah / window.ai

Use your own AI models on the web
https://windowai.io
MIT License
806 stars 70 forks source link

Event listener framework, w/ model changed events #13

Closed alexanderatallah closed 1 year ago

alexanderatallah commented 1 year ago

To listen to events emitted by the extension, such as "model_changed", here's what you do:

window.ai.addEventListener((event: EventType, data: unknown) => {
    // You can check `event` to see if it's the EventType you care about, e.g. "model_changed"
    console.log("EVENT received", event, data)
})
vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
window-ai ✅ Ready (Inspect) Visit Preview Apr 12, 2023 7:39pm