-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 #4555 - DataTable: Add nullSortOrder prop #4570
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
|
||
localeComparator() { | ||
//performance gain using Int.Collator. It is not recommended to use localeCompare against large arrays. | ||
return new Intl.Collator(undefined, { numeric: true }).compare; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The collator only needs to be instantiated once, not once per function call to get the collator.
const localeComparator = new Intl.Collator(undefined, { numeric: true }).compare;
export default {
...
...
localeComparator() {
return localeComparator;
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct in PrimeReact we only instantiate it once outside of the loop.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix #4555 - DataTable: Add nullSortOrder prop and better null/undefined handling in component sort functions.