Events
Lume provides a lightweight event system for communication between components — without tight coupling.
Local Events (Per App)
Section titled “Local Events (Per App)”Local events are scoped to a single Lume app instance. They’re perfect for communication between components that belong to the same app.
Inside a Component
Section titled “Inside a Component”On the App Instance
Section titled “On the App Instance”Global Events (Across Apps)
Section titled “Global Events (Across Apps)”Global events are shared across all Lume app instances on the page. Use them when separate apps need to communicate.
Inside a Component
Section titled “Inside a Component”On the App Instance
Section titled “On the App Instance”When to Use Which?
Section titled “When to Use Which?”| Scenario | Use |
|---|---|
| Components in the same app | Local events (emit/listen) |
| Communication across separate apps | Global events (global.emit/global.listen) |
| External code triggering components | app.emit() |
Auto-Cleanup
Section titled “Auto-Cleanup”All event listeners registered via listen or global.listen inside a component are automatically cleaned up when the component unmounts. No manual removal needed.