MCPcopy
hub / github.com/dosco/graphjin / toAwait

Function toAwait

wasm/util.go:38–46  ·  view source on GitHub ↗
(fn func(resolve, reject js.Value))

Source from the content-addressed store, hash-verified

36}
37
38func toAwait(fn func(resolve, reject js.Value)) js.Value {
39 h := js.FuncOf(func(this js.Value, args []js.Value) interface{} {
40 resolve := args[0]
41 reject := args[1]
42 go fn(resolve, reject)
43 return nil
44 })
45 return js.Global().Get("Promise").New(h)
46}
47
48func toError(err interface{}) error {
49 if v, ok := err.(js.Error); ok {

Callers 4

queryFunction · 0.85
queryByNameFunction · 0.85
subscribeFunction · 0.85
subscribeByNameFunction · 0.85

Calls 1

GetMethod · 0.65

Tested by

no test coverage detected