Skip to content

Commit 1068fc5

Browse files
committed
rename parttoelems to toelems...
1 parent 2893a07 commit 1068fc5

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

tsunami/comp/rootelem.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ func (r *RootElem) renderComponent(cfunc any, elem *vdom.VDomElem, comp **Compon
439439
vc := MakeContextVal(r, *comp, opts)
440440
ctx := vdomctx.WithRenderContext(r.OuterCtx, vc)
441441
renderedElem := callCFunc(cfunc, ctx, props)
442-
rtnElemArr := vdom.PartToElems(renderedElem)
442+
rtnElemArr := vdom.ToElems(renderedElem)
443443
if len(rtnElemArr) == 0 {
444444
r.unmount(&(*comp).Comp)
445445
return

tsunami/vdom/vdom.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ func H(tag string, props map[string]any, children ...any) *VDomElem {
106106
rtn := &VDomElem{Tag: tag, Props: props}
107107
if len(children) > 0 {
108108
for _, part := range children {
109-
elems := PartToElems(part)
109+
elems := ToElems(part)
110110
rtn.Children = append(rtn.Children, elems...)
111111
}
112112
}
@@ -355,12 +355,12 @@ func QueueRefOp(ctx context.Context, ref *VDomRef, op VDomRefOperation) {
355355
vc.QueueRefOp(ctx, op)
356356
}
357357

358-
// PartToElems converts various types into VDomElem slices for use in VDOM children.
358+
// ToElems converts various types into VDomElem slices for use in VDOM children.
359359
// It handles strings, booleans, VDomElems, *VDomElem, slices, and other types
360360
// by converting them to appropriate VDomElem representations.
361361
// nil values are ignored and removed from the final slice.
362362
// This is primarily an internal function and not typically called directly by application code.
363-
func PartToElems(part any) []VDomElem {
363+
func ToElems(part any) []VDomElem {
364364
if part == nil {
365365
return nil
366366
}
@@ -385,7 +385,7 @@ func PartToElems(part any) []VDomElem {
385385
if partVal.Kind() == reflect.Slice {
386386
var rtn []VDomElem
387387
for i := 0; i < partVal.Len(); i++ {
388-
rtn = append(rtn, PartToElems(partVal.Index(i).Interface())...)
388+
rtn = append(rtn, ToElems(partVal.Index(i).Interface())...)
389389
}
390390
return rtn
391391
}

0 commit comments

Comments
 (0)