func ready() {
	bridge.Set("__ready__", true)
	<-make(chan bool, 0)  
}
Toggling the __ready__ value in the bridge lets JS know that everything is setup.
Setting __ready__ to true can help prevent possible race conditions of Wasm being called before everything is
registered, and potentially crashing applications.
package main
import "syscall/js"
var (
	bridgeName = "__go_wasm__"
	bridge js.Value
	wrapper js.Value
)
func newReturnValue(value interface{}) js.Value {
	jsObject := js.Global().Get("Object").New()
	jsObject.Set("result", value)
	return jsObject
}
func newReturnError(goErr error) js.Value {
	jsObject := js.Global().Get("Object").New()
	jsError := js.Global().Get("Error")
	jsObject.Set("error", jsError.New(goErr.Error()))
	return jsObject
}
func wrapGoFunc(f func(js.Value, []js.Value) (interface{}, error)) js.Func {
	return js.FuncOf(func(this js.Value, args []js.Value) interface{} {
		res, err := f(this, args)
		if err != nil {
			return newReturnError(err)
		}
		return newReturnValue(res)
	})
}
func setFunc(name string, f func(js.Value, []js.Value) (interface{}, error)) {
	bridge.Set(name, wrapper.Invoke(wrapGoFunc(f)))
}
func setValue(name string, value interface{}) {
	bridge.Set(name, value)
}