Add GMap component for rendering a map with gomponents

This commit is contained in:
Luis Eduardo Jeréz Girón
2024-07-23 19:08:44 -06:00
parent eaece77e62
commit e848850ae9

View File

@@ -0,0 +1,9 @@
package component
import "github.com/maragudk/gomponents"
// GMap is a convenience function to render a gomponents.Group
// with a map inside.
func GMap[T any](ts []T, cb func(T) gomponents.Node) gomponents.Node {
return gomponents.Group(gomponents.Map(ts, cb))
}