Closed cwastche closed 5 days ago
The latest updates on your projects. Learn more about Vercel for Git โ๏ธ
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
eternum | โ Ready (Inspect) | Visit Preview | ๐ฌ Add feedback | Jul 5, 2024 1:05pm |
โฑ๏ธ Estimated effort to review: 1 ๐ตโชโชโชโช |
๐งช No relevant tests |
๐ No security concerns identified |
โก Key issues to review None |
Category | Suggestion | Score |
Maintainability |
Simplify complex union types using a type alias___ **Consider using a type alias for the complex union type ofprogresses to improve code readability and maintainability. This will make the type easier to reuse and modify in the future.** [client/src/hooks/helpers/useHyperstructures.tsx [98-100]](https://github.com/BibliothecaDAO/eternum/pull/1085/files#diff-bf17af418721188cfc90bf8ed7cc8071cc96c2f61f98a068e77f8027429e61cfR98-R100) ```diff -progresses: ( - | ComponentValue<{ hyperstructure_entity_id: Type.BigInt; resource_type: Type.Number; amount: Type.Number }> - | undefined -)[], +type ProgressType = ComponentValue<{ hyperstructure_entity_id: Type.BigInt; resource_type: Type.Number; amount: Type.Number }> | undefined; +progresses: ProgressType[], ``` Suggestion importance[1-10]: 9Why: Using a type alias for the complex union type of `progresses` improves code readability and maintainability, making it easier to reuse and modify in the future. This suggestion is highly beneficial for the codebase. | 9 |
PR Type
formatting
Description
progresses
parameter type definition ingetAllProgressesAndTotalPercentage
function for better readability.Changes walkthrough ๐
useHyperstructures.tsx
Reformat `progresses` parameter type definition
client/src/hooks/helpers/useHyperstructures.tsx
progresses
parameter type definition for betterreadability.