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
Svyatoslav Kuzmich [JB]
08/14/2023, 2:15 PM
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.
Svyatoslav Kuzmich [JB]
08/14/2023, 2:18 PM
Alternatively you can
@JsExport
Kotlin/Wasm function(s) and then use mentioned JS APIs in regular JS code that imports K/Wasm module