What problem does it solve?
This Skill simplifies complex data fetching, caching, and synchronization in React applications using TanStack Query, eliminating boilerplate code, ensuring consistent state, and improving user experience.
Core Features & Use Cases
- Organized Query Structure: Provides a clean separation of API calls, query keys, and custom hooks for maintainable data fetching logic.
- Infinite & Dependent Queries: Implement advanced pagination (infinite scroll) and manage data dependencies between queries.
- Optimistic Updates & Prefetching: Enhance user experience with instant UI feedback for mutations and improved perceived performance through data preloading.
- Use Case: When integrating a new API endpoint for a paginated list of users, use this skill to generate the
useInfiniteUsers hook, userKeys factory, and usersApi service, complete with caching and invalidation strategies.
Quick Start
Use the query-patterns skill to generate a basic useQuery hook for fetching a list of products, including query keys and API service.