Compare commits

..

No commits in common. "master" and "reflect_from" have entirely different histories.

3 changed files with 16 additions and 5 deletions

@ -3,7 +3,7 @@
<head>
<meta charset="utf-8" />
<title>Golang-WASM</title>
<title>Example</title>
</head>
<body>

@ -13,8 +13,19 @@ func main() {
<-c
}
const hello = "Sample value"
func helloName(_ js.Value, args []js.Value) interface{} {
return fmt.Sprintf("Hello, %s!", args[0].String())
}
func setup() {
fmt.Println("golang-wasm initialized")
bridge := js.Global().Get("__go_wasm__")
bridge.Set("__ready__", true)
bridge.Set("hello", hello)
bridge.Set("helloName", js.FuncOf(helloName))
js.Global()
}

@ -1,11 +1,11 @@
{
"name": "golang-wasm",
"version": "0.0.1",
"name": "go-mod-wasm",
"version": "0.1.0",
"description": "A webpack-based configuration to work with wasm using Go.",
"main": "src/index.js",
"repository": {
"type": "git",
"url": "https://gitea.teamortix.com/Team-Ortix/golang-wasm"
"url": "https://gitea.teamortix.com/Team-Ortix/go-mod-wasm"
},
"keywords": [
"golang",