how would I get my kotlin js/webassembly to A) bi...
# webassembly
m
how would I get my kotlin js/webassembly to A) bind to navigator () apis in the browser B) get installed and managed as a service worker ?
s
I haven’t used Kotlin/Wasm with APIs you mentioned. But, in general, you can pass Kotlin lambdas to JS functions https://kotlinlang.org/docs/wasm-js-interop.html#jsfun-annotation, and they will behave like regular JS function references which you can register as callbacks in JS code.
Alternatively you can
@JsExport
Kotlin/Wasm function(s) and then use mentioned JS APIs in regular JS code that imports K/Wasm module
1