Skip to content
Source
Sign inSign up
TanStack/query
Open History to see the last commit

README.md

14 lines579 Bytes

1# TanStack Vue Query Simple Example
2​
3Fetches a single GitHub repository and shows its stats.
4​
5## How it works
6​
7- `src/services/repos/queries.ts` defines `reposQueries.detail()`, a `queryOptions` factory keyed by `['repos', 'detail']` that fetches the `TanStack/query` repository from the GitHub API.
8- `src/App.vue` reads it with `useQuery(reposQueries.detail())` and shows the repository's name, description and counts, with "Updating..." while `isFetching` is `true`.
9- `src/main.ts` installs `VueQueryPlugin` on the app.
10​
11To run this example:
12​
13- `npm install`
14- `npm run dev`