mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-11 06:23:39 +00:00
wasm: add support for js.FuncOf
This commit is contained in:
@@ -37,9 +37,16 @@ func putchar(c byte) {
|
||||
resource_write(stdout, &c, 1)
|
||||
}
|
||||
|
||||
var handleEvent func()
|
||||
|
||||
//go:linkname setEventHandler syscall/js.setEventHandler
|
||||
func setEventHandler(fn func()) {
|
||||
// TODO
|
||||
handleEvent = fn
|
||||
}
|
||||
|
||||
//go:export resume
|
||||
func resume() {
|
||||
handleEvent()
|
||||
}
|
||||
|
||||
//go:export go_scheduler
|
||||
|
||||
Reference in New Issue
Block a user