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

Enum : Use the given String parameter to fill the value #10

Closed
glureau opened this issue Jan 25, 2022 · 1 comment
Closed

Enum : Use the given String parameter to fill the value #10

glureau opened this issue Jan 25, 2022 · 1 comment

Comments

@glureau
Copy link
Collaborator

glureau commented Jan 25, 2022

Currently we can define an enum like that

enum class Foo(val value: String) {
  ONE("one"), TWO("hey")
}

But once wrapped, there is no way to get the parameters. We don't want to support all super-powers of Kotlin enums right now. Using the given parameter if there is only one string, and returning the value in the facade could be enough.

@glureau
Copy link
Collaborator Author

glureau commented Jan 26, 2022

23c0198

I actually provided all properties of the enum to the JS facade, as it's easier for now (waiting to see how Kotlin 1.6.20 handle enum exports).

'name' and 'ordinal' are Kotlin enum keywords and cannot be override, also KustomExport override "name" to put the entry name (as a string, so minification should be fine). 'ordinal' is not provided in the facade, I don't think using ordinal make a lot of sense, but please comment if you have a use case!

@glureau glureau closed this as completed Jan 26, 2022
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