Implements efficient stale-while-revalidate data fetching patterns with advanced caching, background revalidation, and optimistic updates.
This skill provides comprehensive guidance for implementing the SWR (stale-while-revalidate) strategy in modern web applications to create fast, responsive user interfaces. It enforces best practices for typed fetchers, distinguishes between initial loading and background validation states, and provides robust patterns for write operations using useSWRMutation. By leveraging this skill, developers can easily implement advanced features like infinite scrolling, optimistic UI updates with automatic rollbacks, and complex dependent queries while avoiding common pitfalls like unstable keys and infinite re-render loops.
주요 기능
01Stale-while-revalidate caching for instant UI feedback
02Typed fetcher implementations with error handling
03Conditional and dependent query management
040 GitHub stars
05Advanced pagination and infinite scroll patterns
06Optimistic UI updates with automatic error rollback
사용 사례
01Implementing infinite scrolling news feeds or activity logs
02Building read-heavy dashboards that require background data synchronization
03Creating high-performance forms with instant local state updates