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

Fix #2467: Typescript use enums for options #2488

Merged
merged 1 commit into from
Dec 13, 2021

Conversation

melloware
Copy link
Member

###Defect Fixes
Fix #2467: Typescript use enums for options

Using Typescript enum is the more correct way to represent these options

@jafin
Copy link
Contributor

jafin commented Dec 4, 2021

Would you consider preferring union types instead of enums?
https://fettblog.eu/tidy-typescript-avoid-enums/
and
https://blog.bam.tech/developer-news/should-you-use-enums-or-union-types-in-typescript

for justification.

@melloware
Copy link
Member Author

@jafin this will probably be Primetek's preferred approach to use union types as that is how all of the rest of the code base is. However it was curious they chose to go this Interface route with static read-only when from reading their examples it LOOKS like they wanted an enum for FilterMatchMode.IN etc.

Thoughts?

@jafin
Copy link
Contributor

jafin commented Dec 11, 2021

@melloware if existing code follows a convention, I assume that would be the approach.

@mertsincan mertsincan merged commit 4100afd into primefaces:master Dec 13, 2021
@mertsincan
Copy link
Member

Thank a lot, @jafin and @melloware! For now, the 'enum' definition seems appropriate for this issue. I'll talk to our team for improvements.

@melloware melloware deleted the PR2467 branch December 13, 2021 12:33
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

Successfully merging this pull request may close these issues.

Typescript DataTables with filters don't import or compile correctly.
4 participants