You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// This function is imported from JavaScript, as it doesn't define a body.
// You should define a function named 'main.add' in the WebAssembly 'env'
// module from JavaScript.
func add(x, y int) int
thankfully @aykevl pointed out that this "method" (define an exported function) seems to be a deprecated, so the documentation needs an update tinygo-org/tinygo-site#305, this got me wondering:
While trying to follow the guide:
https://tinygo.org/docs/guides/webassembly/
got a little confused since I couldn't figure out how to define an exported (js) function :
so decided to ask in slack:

https://gophers.slack.com/archives/CDJD3SUP6/p1666832165660899
thankfully @aykevl pointed out that this "method" (define an exported function) seems to be a deprecated, so the documentation needs an update tinygo-org/tinygo-site#305, this got me wondering:
what is the correct way to call an external js function from wasm, is it using syscall/js ?
some of the wasm examples https://github.com/tinygo-org/tinygo/tree/release/src/examples/wasm seem to be over 4 years old, may be a review of them is necessary ?
glad to help in any way
The text was updated successfully, but these errors were encountered: