@@ -29,7 +29,7 @@ func rootHandler(w http.ResponseWriter, r *http.Request) {
29
29
"rel" : "stylesheet" ,
30
30
})
31
31
32
- meta := []func () string {
32
+ meta := []HTML {
33
33
H ("meta" , Attr {"charset" : "UTF-8" }),
34
34
H ("meta" , Attr {
35
35
"name" : "viewport" ,
@@ -49,9 +49,9 @@ func rootHandler(w http.ResponseWriter, r *http.Request) {
49
49
w .Write ([]byte (html ()))
50
50
}
51
51
52
- func navItems (user User ) []func () string {
52
+ func navItems (user User ) []HTML {
53
53
// get itmes from somewhere such as a database
54
- items := []func () string {H ("li" , "item one" ), H ("li" , "item two" )}
54
+ items := []HTML {H ("li" , "item one" ), H ("li" , "item two" )}
55
55
56
56
// example runtime modification
57
57
lastElement := H ("li" , user .Name )
@@ -60,7 +60,7 @@ func navItems(user User) []func() string {
60
60
}
61
61
62
62
// AppComponent is a daz component. It returns a daz.H func
63
- func AppComponent (user User , description string ) func () string {
63
+ func AppComponent (user User , description string ) HTML {
64
64
nav := H ("nav" , navItems (user ))
65
65
return H (
66
66
"div" , Attr {"class" : "bg-grey-50" },
0 commit comments