feat: improve real-time chart example; add small refinements to via core files

This commit is contained in:
Joao Goncalves
2025-11-07 00:44:48 -01:00
parent c167f0c74f
commit 798f024743
7 changed files with 63 additions and 20 deletions

View File

@@ -12,7 +12,13 @@ type actionTrigger struct {
}
// OnClick returns a via.h DOM node that triggers on click. It can be added
// to other nodes in a view.
// to element nodes in a view.
func (a *actionTrigger) OnClick() h.H {
return h.Data("on:click", fmt.Sprintf("@get('/_action/%s')", a.id))
}
// OnChange returns a via.h DOM node that triggers on input change. It can be added
// to element nodes in a view.
func (a *actionTrigger) OnChange() h.H {
return h.Data("on:change__debounce.200ms", fmt.Sprintf("@get('/_action/%s')", a.id))
}