Skip to content

About

Interactive playground to learn TanStack Query visually — query, mutation, cache, optimistic updates, pagination, and infinite scroll.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Server State Playground

An interactive playground for learning TanStack Query visually. Each example lets you trigger real network requests and observe the full data lifecycle — status transitions, cache behavior, optimistic updates, and more — all in one place.

Live demo: tanstack-query.dzulfan.dev


Examples

Example Concepts
Query useQuery, pending/success/error states, manual refetch()
Mutation useMutation, write lifecycle, invalidateQueries
Cache staleTime, gcTime, fresh → stale countdown, cache hits
Optimistic Update onMutate, snapshot & rollback, cancelQueries
Pagination keepPreviousData, per-page query keys, instant transitions
Infinite Query useInfiniteQuery, getNextPageParam, fetchNextPage

Each example includes:

  • An interactive playground to trigger fetches, mutations, and errors
  • A live Query Inspector showing real-time query state
  • An Event Timeline tracing what happened and when
  • Embedded code snippets for the hook and API layer
  • An Engineering Insight explaining the problem, solution, and tradeoffs

Tech Stack


Running Locally

git clone https://github.com/dzulfanf/tanstack-query.git
cd tanstack-query
npm install
npm run dev

Open http://localhost:5173.

About

Interactive playground to learn TanStack Query visually — query, mutation, cache, optimistic updates, pagination, and infinite scroll.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages