A website written in Go using WebAssembly and Vugu that converts strings to and from various encodings.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
846 B

// +build wasm
package main
import (
"fmt"
"flag"
"github.com/vugu/vugu"
"github.com/vugu/vugu/domrender"
)
func main() {
mountPoint := flag.String("mount-point", "#vugu_mount_point", "The query selector for the mount point for the root component, if it is not a full HTML component")
flag.Parse()
fmt.Printf("Entering main(), -mount-point=%q\n", *mountPoint)
defer fmt.Printf("Exiting main()\n")
renderer, err := domrender.New(*mountPoint)
if err != nil {
panic(err)
}
defer renderer.Release()
buildEnv, err := vugu.NewBuildEnv(renderer.EventEnv())
if err != nil {
panic(err)
}
rootBuilder := vuguSetup(buildEnv, renderer.EventEnv())
for ok := true; ok; ok = renderer.EventWait() {
buildResults := buildEnv.RunBuild(rootBuilder)
err = renderer.Render(buildResults)
if err != nil {
panic(err)
}
}
}