invoke callback if defined

This commit is contained in:
Alexander Wang 2023-09-25 11:29:33 -07:00 committed by Maricaya
parent 6277d6db63
commit 084a62ce85
No known key found for this signature in database
GPG key ID: 91DA6031E30DE02F

View file

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