Files
Reims-Go/internal/app/events.go
T
NwflowerandClaude Opus 5.5 b203bde650 refactor: merge duplicated helpers and the window event contract
Events to the frontend go through App.emit, and a test keeps their names
in step with wails.ts. QEMU argument splitting, hidden console processes,
the macOS release record, the running check and a few smaller helpers
now exist once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-03 21:09:19 -07:00

15 lines
465 B
Go

package app
import wailsRuntime "github.com/wailsapp/wails/v2/pkg/runtime"
// emit sends an event to the frontend, which subscribes in frontend/src/wails.ts.
// Without a window it does nothing.
func (a *App) emit(name string, data ...any) {
if a.ctx != nil {
wailsRuntime.EventsEmit(a.ctx, name, data...)
}
}
// emitStateChanged asks the frontend to read the application state again.
func (a *App) emitStateChanged() { a.emit("reims:state-changed", true) }