invoke callback if defined

This commit is contained in:
Alexander Wang 2023-09-25 11:29:33 -07:00
parent b5179d989f
commit 50f01f3fc3
No known key found for this signature in database
GPG key ID: BE3937D0D52D8927

View file

@ -26,6 +26,10 @@ func main() {
js.Global().Set("d2Parse", js.FuncOf(jsParse))
js.Global().Set("d2Encode", js.FuncOf(jsEncode))
js.Global().Set("d2Decode", js.FuncOf(jsDecode))
initCallback := js.Global().Get("onWasmInitialized")
if !initCallback.IsUndefined() {
initCallback.Invoke()
}
select {}
}