MCPcopy
hub / github.com/wavetermdev/waveterm / CallFn

Method CallFn

pkg/vdom/vdom_root.go:172–189  ·  view source on GitHub ↗
(event VDomEvent)

Source from the content-addressed store, hash-verified

170}
171
172func (vdf *VDomFunc) CallFn(event VDomEvent) {
173 if vdf.Fn == nil {
174 return
175 }
176 rval := reflect.ValueOf(vdf.Fn)
177 if rval.Kind() != reflect.Func {
178 return
179 }
180 rtype := rval.Type()
181 if rtype.NumIn() == 0 {
182 rval.Call(nil)
183 }
184 if rtype.NumIn() == 1 {
185 if rtype.In(0) == reflect.TypeOf((*VDomEvent)(nil)).Elem() {
186 rval.Call([]reflect.Value{reflect.ValueOf(event)})
187 }
188 }
189}
190
191func callVDomFn(fnVal any, data VDomEvent) {
192 if fnVal == nil {

Callers

nothing calls this directly

Calls 1

TypeMethod · 0.80

Tested by

no test coverage detected