-
Notifications
You must be signed in to change notification settings - Fork 85
Open
Open
Copy link
Labels
Ever TeamsImprovementImprovementImprovementWEBWeb appWeb appenhancementNew feature or requestNew feature or request
Description
The goal of this task is to extract all globally reusable hooks from core/hooks/ and place them in a shared package: packages/hooks → @ever-teams/hooks
This will allow us to:
- Reuse them in future on other apps like our Ever Teams React Native apps
- Ensure shared logic is centralized and versioned
- Improve maintainability and testing
Scope of Hooks to Extract
Target generic, cross-app hooks, typically located under core/hooks/common/ or used widely in multiple features, such as:
useModalusePaginationuseQueryuseLocalStorageStateuseFirstLoaduseLanguageuseDateRangeuseDetectOSuseHasMounteduseScrollListeneruseCheckAPIuseOutsideClick
Any hook that does not rely on specific business entities in the web part (user, task, project, etc.) and can be reused in other apps should be extracted here.
Implementation Plan
- Identify candidate hooks inside
core/hooks/common/orcore/hooks/*/that can be reused outside of the web app. - Move the implementation to
packages/hooks/src/[domain]. - Each hook must be:
- Written in TypeScript
- Exported from
packages/hooks/src/index.ts - Covered with proper inline documentation
- Update imports in
apps/webto use:import { useModal } from '@ever-teams/hooks';
- Add usage examples (if applicable) in `/apps/playground
Notes
- All moved hooks must be free from direct dependencies to
@/app,@/core, or Next.js router - Add comments and types where needed for external consumption
- Test the hooks properly (usage tests)
Reviewers
@NdekoCodefor final review and approval@Thierryfor testing and usage validation inapps/web
Metadata
Metadata
Labels
Ever TeamsImprovementImprovementImprovementWEBWeb appWeb appenhancementNew feature or requestNew feature or request
Type
Projects
Status
No status