-
-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use a consistent sort order for skills.
GitOrigin-RevId: 0a44628893431e14428ded65bf153e5de7a9c482
- Loading branch information
Showing
3 changed files
with
24 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Skills } from '@deities/athena/info/Skill.tsx'; | ||
import { useMemo } from 'react'; | ||
|
||
export default function useSkills( | ||
skills: ReadonlyArray<number> | null | undefined, | ||
) { | ||
return useMemo(() => { | ||
const currentSkills = new Set(skills); | ||
// Skills should always be sorted by the internal sort order. | ||
return new Set([...Skills].filter((skill) => currentSkills.has(skill))); | ||
}, [skills]); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters