Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/DogPawHat/lazy-query-test.
Something went wrong. Try again.
Files
- TypeScript 83%
- CSS 17%
README.md
Lazy Query Test #
Interactive TanStack Query demos that focus on lazy/conditional fetching patterns in React.
Live Demo #
Netlify: https://lazy-query-test.netlify.app/
Project Overview #
This app demonstrates three ways to control when queries run:
enabled: false+refetch()for manual fetchingenabled: !!valuefor condition-based fetchingskipTokenfor declaratively skipping a query when inputs are missing
Each route includes:
- A small, runnable UI example
- Query state inspection to visualize status flags
- Practical behavior for loading, empty, and data states
Routes #
/- landing page linking to all demos/manual-fetch- manual query trigger withrefetch()/conditional-query- query enabled only when input exists/skip-token-skipTokenpattern for optional query functions
Local Development #
pnpm install
pnpm dev
Default dev server: http://localhost:3000
Scripts #
pnpm dev # Start local dev server
pnpm build # Build production bundle
pnpm preview # Preview production build locally
pnpm test # Run tests
pnpm lint # Run lint checks
pnpm lint:fix # Auto-fix lint issues
pnpm format # Format code
pnpm format:check # Check formatting only