6deef76427
Funciones Go para crear apps Wails: scaffold estructura, bind CRUD genérico, build multiplataforma, emit eventos y stream de datos al frontend. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1.1 KiB
1.1 KiB
name, kind, lang, domain, version, purity, signature, description, tags, uses_functions, uses_types, returns, returns_optional, error_type, imports, tested, tests, test_file_path, file_path
| name | kind | lang | domain | version | purity | signature | description | tags | uses_functions | uses_types | returns | returns_optional | error_type | imports | tested | tests | test_file_path | file_path | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| wails_emit_event | function | go | infra | 1.0.0 | impure | WailsEmitEvent(ctx context.Context, eventName string, data interface{}) | Emite eventos tipados de Go al frontend con timestamp automático. Incluye WailsEmitJSON para serialización explícita. |
|
false | error_go_core |
|
false | functions/infra/wails_emit_event.go |
Ejemplo
// Emitir evento tipado
WailsEmitEvent(ctx, "price:update", PriceData{Symbol: "BTC", Price: 67500.0})
// El frontend lo recibe con useWailsEvent:
// useWailsEvent({ eventName: 'price:update', onEvent: (data) => ... })
Notas
El evento llega al frontend como WailsEventPayload con type, data y timestamp. Complementa use_wails_event del lado TS. Requiere la dependencia github.com/wailsapp/wails/v2 en el proyecto destino.