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:
useModal
usePagination
useQuery
useLocalStorageState
useFirstLoad
useLanguage
useDateRange
useDetectOS
useHasMounted
useScrollListener
useCheckAPI
useOutsideClick
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/ or core/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/web to 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
@NdekoCode for final review and approval
@Thierry for testing and usage validation in apps/web
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/hooksThis will allow us to:
Scope of Hooks to Extract
Target generic, cross-app hooks, typically located under
core/hooks/common/or used widely in multiple features, such as:useModalusePaginationuseQueryuseLocalStorageStateuseFirstLoaduseLanguageuseDateRangeuseDetectOSuseHasMounteduseScrollListeneruseCheckAPIuseOutsideClickAny 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
core/hooks/common/orcore/hooks/*/that can be reused outside of the web app.packages/hooks/src/[domain].packages/hooks/src/index.tsapps/webto use:Notes
@/app,@/core, or Next.js routerReviewers
@NdekoCodefor final review and approval@Thierryfor testing and usage validation inapps/web