MCPcopy
hub / github.com/lmorg/murex / wasmShellStart

Function wasmShellStart

main_js.go:81–101  ·  view source on GitHub ↗

wasmShellStart starts the interactive shell as a Promise

()

Source from the content-addressed store, hash-verified

79
80// wasmShellStart starts the interactive shell as a Promise
81func wasmShellStart() js.Func {
82 return js.FuncOf(func(this js.Value, args []js.Value) any {
83
84 handler := js.FuncOf(func(this js.Value, args []js.Value) any {
85 resolve := args[0]
86 //reject := args[1]
87
88 go func() {
89 resolve.Invoke("Starting interactive shell....")
90 shell.Start()
91 }()
92
93 // The handler of a Promise doesn't return any value
94 return nil
95 })
96
97 // Create and return the Promise object
98 promiseConstructor := js.Global().Get("Promise")
99 return promiseConstructor.New(handler)
100 })
101}
102
103// wasmKeyPress starts the interactive shell as a Promise
104func wasmKeyPress() js.Func {

Callers 1

mainFunction · 0.85

Calls 3

StartFunction · 0.92
NewMethod · 0.65
GetMethod · 0.45

Tested by

no test coverage detected