react-native-select icon indicating copy to clipboard operation
react-native-select copied to clipboard

chore: refactored code to use custom hooks

Open azeezat opened this issue 1 year ago β€’ 1 comments

Description

Extracted most of the functions in the index.ts file into custom react hooks to improve readability. Feel free to check and comment on this PR. Everything should work as before so if you notice any changes, please drop a comment.

  • [x] Code cleanup

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration Added unit tests to ensure that the library continues to function as it currently does.

Checklist:

  • [x] My code follows the style guidelines of this project
  • [x] I have performed a self-review of my code
  • [x] I have commented my code, particularly in hard-to-understand areas
  • [x] I have made corresponding changes to the documentation
  • [x] My changes generate no new warnings
  • [x] I have added tests that prove my fix is effective or that my feature works
  • [x] New and existing unit tests pass locally with my changes
  • [x] Any dependent changes have been merged and published in downstream modules

azeezat avatar Sep 09 '24 06:09 azeezat

Coverage report

St.:grey_question:
Category Percentage Covered / Total
🟒 Statements
95.79% (+39.25% πŸ”Ό)
250/261
🟒 Branches
94.31% (+40.91% πŸ”Ό)
199/211
🟒 Functions
94.29% (+47.41% πŸ”Ό)
99/105
🟒 Lines
96.47% (+39.82% πŸ”Ό)
246/255
Show new covered files 🐣
St.:grey_question:
File Statements Branches Functions Lines
🟒
... / DropdownFlatList.tsx
100% 100% 100% 100%
🟒
... / DropdownSectionList.tsx
93.94% 100% 85.71% 93.75%
🟒 hooks/use-search.ts 100% 100% 100% 100%
🟒
... / use-selection-handler.ts
78.26% 64.29% 80% 81.82%
🟒
... / use-index-of-selected-item.ts
100% 83.33% 100% 100%
🟒 hooks/use-modal.ts 94.12% 75% 100% 100%
🟒
... / use-select-all.ts
100% 100% 100% 100%
🟒 hooks/index.ts 100% 100% 100% 100%

Test suite run success

24 tests passing in 3 suites.

Report generated by πŸ§ͺjest coverage report action from 8ae10a7639c8245c3edfaedcd6e0cf18b89000a0

github-actions[bot] avatar Sep 09 '24 10:09 github-actions[bot]