Skip to content

Commit a086179

Browse files
committed
fix go docs
1 parent c55631d commit a086179

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

tsunami/vdom/vdom.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,15 @@ func H(tag string, props map[string]any, children ...any) *VDomElem {
100100
}
101101

102102
// JSFunc creates a VDomFunc that executes client-side JS only, with no backend call.
103-
// jsCode must be a JS function expression with signature: (e, elem) => { ... }
103+
// jsCode must be a JS function expression whose signature matches the natural arguments of the event handler
104+
// (e.g. (e) => { ... } for DOM events, or whatever args the underlying handler receives).
104105
func JSFunc(jsCode string) *VDomFunc {
105106
return &VDomFunc{Type: ObjectType_Func, JsCode: jsCode, PreventBackend: true}
106107
}
107108

108109
// CombinedFunc creates a VDomFunc that executes client-side JS first, then fires to the backend.
109-
// jsCode must be a JS function expression with signature: (e, elem) => { ... }
110+
// jsCode must be a JS function expression whose signature matches the natural arguments of the event handler
111+
// (e.g. (e) => { ... } for DOM events, or whatever args the underlying handler receives).
110112
func CombinedFunc(jsCode string, fn any) *VDomFunc {
111113
return &VDomFunc{Type: ObjectType_Func, JsCode: jsCode, Fn: fn}
112114
}

0 commit comments

Comments
 (0)