-
-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor user selection state handling using hook
This commit introduces `useUserSelection`, a new compositional hook designed to centralize and reuse the logic for tracking and mutating user selection state across the application. The change aims to increase code reusability, simplify the code, improve testability, and adhere to the single responsibility principle. It makes the code more error-prone due to race conditions and independent of Vue's deep tracking. Other supporting changes: - A new `CardStateIndicator` component is introduced for displaying the card state indicator icon, enhancing the testability and separation of concerns. - `SelectionTypeHandler` is refactored to use functional code with more clear interfaces to simplify the codebase. This should reduce complexity, increase maintainability and increase readability by explicitly separating mutating functions. - Unit tests have been added to cover the new logic introduced in this refactor.
- Loading branch information
1 parent
7770a9b
commit 93736d9
Showing
22 changed files
with
701 additions
and
465 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
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
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
Oops, something went wrong.