What problem does it solve?
Writing custom React hooks that integrate seamlessly with a three-layer Epic architecture is complex and repetitive. It standardizes hooks for state management, server actions, optimistic updates, and validation, reducing boilerplate and ensuring consistency across frontend components.
Core Features & Use Cases
- Enforces a single backend entry point (action or route) per hook to simplify reasoning and testing.
- Provides optimistic UI updates with rollback support to improve perceived performance.
- Validates input with Zod schemas and keeps rendering side effects isolated from server logic.
- Supports standard and streaming routes, including cancellation for long-running tasks.
- Encourages organizing hooks under app/[role]/[page]/behaviors/[behavior-name]/hooks/use-<behavior-name>.ts.
Quick Start
Create a new hook file under app/[role]/[page]/behaviors/[behavior-name]/hooks/use-<behavior-name>.ts and implement it following the Epic three-layer architecture.