Robert Jaros
03/19/2025, 1:43 PMRequestInit object from kotlin-wrappers in common or wasmjs code? The invoke() is only available (generated somehow?) in the js source set.turansky
03/19/2025, 5:27 PMRobert Jaros
03/19/2025, 6:07 PMRobert Jaros
03/19/2025, 6:15 PMRobert Jaros
03/19/2025, 6:17 PMRobert Jaros
03/19/2025, 6:24 PMrequestFilter: (suspend RequestInit.() -> Unit)? = null. RequestInit from stdlib has `var`s, so the user can modify the provided request parameters. With `val`s it can't be done so easy.turansky
03/19/2025, 7:25 PMRobert Jaros
03/19/2025, 7:59 PMvar you can do the same as with val and more. And the JS objects are mutable anyway, so why not use mutable Kotlin values?turansky
03/20/2025, 12:48 AMcopy is more kotlinish solution for this case.turansky
03/20/2025, 12:50 AMcopy method for transformation.turansky
03/20/2025, 12:52 AMjs-plain-objects plugin support for WasmJS.
cc @Artem Kobzarturansky
03/20/2025, 1:19 AMAnd the JS objects are mutable anyway
No. It can be frozen 🧌 With Object.freeze or new JSON.parseImmutable https://github.com/tc39/proposal-json-parseimmutable
turansky
03/20/2025, 1:20 AMRobert Jaros
03/20/2025, 4:17 AM