Skip to content

Instantly share code, notes, and snippets.

@tj
Created April 5, 2017 05:10
Show Gist options
  • Save tj/772db7933734760294814a60f6d5b8d7 to your computer and use it in GitHub Desktop.
Save tj/772db7933734760294814a60f6d5b8d7 to your computer and use it in GitHub Desktop.
// Package preact provides bindings to the preact library.
package preact
import "github.com/gopherjs/gopherjs/js"
var preact = js.Global.Get("preact")
// Attrs of an element.
type Attrs map[string]interface{}
// H returns a new element.
func H(v ...interface{}) *js.Object {
return preact.Call("h", v...)
}
// Render function.
func Render(args ...interface{}) {
preact.Call("render", args...)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment