Skip to content

Commit

Permalink
consistent ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewmueller committed Dec 4, 2017
1 parent 7caad69 commit 202866f
Show file tree
Hide file tree
Showing 112 changed files with 47,108 additions and 47,097 deletions.
11 changes: 8 additions & 3 deletions internal/vdom/inputs/vdom.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
package vdom

import (
"github.com/matthewmueller/golly/dom/document"
"github.com/matthewmueller/joy/macro"
)

//go:generate go run internal/gen.go

// Use fn
Expand Down Expand Up @@ -40,9 +45,9 @@ type Node interface {
}

// Render the component
// func Render(component Child, parent *document.Node, merge *document.Node) {
// macro.Rewrite("$1.render($2, $3, $4)", File(), component, parent, merge)
// }
func Render(component Child, parent document.Node, merge document.Node) {
macro.Rewrite("$1.render($2, $3, $4)", File(), component, parent, merge)
}

// String turns the component into a string
func String(component Child) string {
Expand Down
7 changes: 4 additions & 3 deletions internal/vdom/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ func main() {
if err := generate(); err != nil {
log.WithError(err).Fatal("error generating")
}
log.Infof("done")
}

func generate() error {
Expand Down Expand Up @@ -70,14 +71,14 @@ func generate() error {
}
for _, iface := range api.Interfaces {
for _, event := range iface.Events {
if _, isset := eventmap[event.Name]; isset {
eventmap[event.Name] = "func (e window." + event.Type + ")"
if _, isset := eventmap["on"+event.Name]; isset {
eventmap["on"+event.Name] = "func (e window." + event.Type + ")"
}
}
}
for name, kind := range eventmap {
if kind == "" {
return errors.Wrapf(err, "missed an event in browser apis %s", name)
return fmt.Errorf("missed an event in browser apis %s", name)
}
}

Expand Down
Loading

0 comments on commit 202866f

Please sign in to comment.