Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add better copy method to data classes #42

Open
atollk opened this issue Aug 27, 2023 · 0 comments
Open

Add better copy method to data classes #42

atollk opened this issue Aug 27, 2023 · 0 comments

Comments

@atollk
Copy link

atollk commented Aug 27, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant