Problem
20+ individual hooks each wire their own loading/error/mutation plumbing. No shared cache key ownership. Components manage hook complexity instead of just rendering.
Solution
Replace with domain modules:
hooks/lessons/useLessons.ts — exports useLesson(id), useLessons(), useCreateLesson(), useUpdateLesson(), useDeleteLesson()
hooks/assignments/useAssignments.ts
hooks/users/useUsers.ts
hooks/lists/useLists.ts
hooks/practiceWords/usePracticeWords.ts
Each module owns its cache keys and invalidation strategy.
Commits
28: Move useAddLesson + useEditLesson into hooks/lessons/, update imports
29: Create useLessons.ts domain module, migrate components one at a time
30: Delete old individual lesson hooks
31-35: Repeat for assignments, users, lists, practiceWords domains
Part of architecture roadmap
#292 — Phase 5
Problem
20+ individual hooks each wire their own loading/error/mutation plumbing. No shared cache key ownership. Components manage hook complexity instead of just rendering.
Solution
Replace with domain modules:
hooks/lessons/useLessons.ts— exports useLesson(id), useLessons(), useCreateLesson(), useUpdateLesson(), useDeleteLesson()hooks/assignments/useAssignments.tshooks/users/useUsers.tshooks/lists/useLists.tshooks/practiceWords/usePracticeWords.tsEach module owns its cache keys and invalidation strategy.
Commits
28: Move useAddLesson + useEditLesson into hooks/lessons/, update imports
29: Create useLessons.ts domain module, migrate components one at a time
30: Delete old individual lesson hooks
31-35: Repeat for assignments, users, lists, practiceWords domains
Part of architecture roadmap
#292 — Phase 5