deezer/KustomExport

Add better copy method to data classes

Opened this issue · 0 comments

atollk commented

For Kotlin data classes, JsExport generates a copy that basically has the same signature as the Kotlin method, i.e. one parameter for each class property. The problem is that JS and TS do not support named arguments, so you always have to specify all parameters. The typical way to simulate this behavior in JS is to use single parameter functions which take in a single object and that object represents a map of parameter names to values.

It seems like a nice feature, if KustomExport could generate alternative copy methods for data classes that are represented by this type of method.