I am starting a multi platform project and I’d lik...
# javascript
d
I am starting a multi platform project and I’d like to send a javascript browser
Event
to the jvm backend. In javascript I might normally do something like
JSON.parse(stringifyEvent(event))
where
stringifyEvent
is a function described in https://stackoverflow.com/questions/11547672/how-to-stringify-event-object/34519193#34519193. Would I need to basically do the same solution in Kotlin or is there something a bit better, perhaps built in or a library? Alternatively is there some other method to send browser events to a jvm backend?
v
use both on the backend and frontend kotlinx.serialization. use JSON.parse() when working with kotlin objects, as enums + lists in Kotlin objects (and probably much more) are not supported…