how do I handle messages? I'm a bit confused by th...
# javascript
v
how do I handle messages? I'm a bit confused by this declaration:
var onmessage: ((Event) -> dynamic)?
n
Many of the web APIs that can be used in Kotlin JS are accessed via the Kotlin JS standard library (are just API wrappers). Often with web APIs it is helpful to look at the MDN documentation, like with the WebSocket onmessage property for example: https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/onmessage .
Usually the web API wrappers in the standard library are very closely aligned with the web APIs themselves (with some minor differences - mainly with null safety).