Open History to see the last commit
TanStack Svelte Query Simple Example#
Fetches a single GitHub repository and shows its stats.
How it works#
src/App.sveltecreates aQueryClientand provides it to the app withQueryClientProvider.src/lib/Simple.sveltecallscreateQuerywith an inlinequeryKey: ['repoData']and aqueryFnthat fetches theTanStack/queryrepository from the GitHub API.- It renders the loading state from
isPending, the error fromerror, and the repository stats fromdataonceisSuccessistrue.
To run this example:
npm installnpm run dev