Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion web/src/utils/unique-array.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export const uniqueArray = <T>(arr: Array<T>): Array<T> => [...new Set(arr)];
export const uniqueArray = <T>(arr: Array<T>): Array<T> =>
[...new Set(arr)].sort();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that you changed at the shared place.
Will this affect all places where this function is being used? Is that ok?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, I confirmed that this one only is used in related places we want. And besides, having a sorted set is a good point as well, so I think it's okay to make change like this.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If that how about renaming it to sortedArray to be precise.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, I rename it as sortedSet 🙆‍♀️