Skip to content

Commit beaf22b

Browse files
committed
invoke callback if defined
1 parent 0266cbd commit beaf22b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

d2js/js.go

+4
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ func main() {
2626
js.Global().Set("d2Parse", js.FuncOf(jsParse))
2727
js.Global().Set("d2Encode", js.FuncOf(jsEncode))
2828
js.Global().Set("d2Decode", js.FuncOf(jsDecode))
29+
initCallback := js.Global().Get("onWasmInitialized")
30+
if !initCallback.IsUndefined() {
31+
initCallback.Invoke()
32+
}
2933
select {}
3034
}
3135

0 commit comments

Comments
 (0)