cover image source: egghead.io
The tools
Getting started
import “syscall/js”
$ GOARCH=wasm GOOS=js go build ...
Setting values
js.Global()
js.Global().Set(“varname”, js.ValueOf(x))
Console logging
println()
Expose **callbacks**
Js.Global().Set(“ftname”, js.NewCallback(f))
Interoperability
func f(i []js.Value) {
// f(a), i[0]=a
// f(a,b), i[0]=a, i[1]=b
// ...
}
Illustrations
to be continued
Top comments (0)