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> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<title>Golang-WASM</title> <title>Example</title>
</head> </head>
<body> <body>

@ -13,8 +13,19 @@ func main() {
<-c <-c
} }
const hello = "Sample value"
func helloName(_ js.Value, args []js.Value) interface{} {
return fmt.Sprintf("Hello, %s!", args[0].String())
}
func setup() { 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() js.Global()
} }

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