Skip to content

Commit 0658f3f

Browse files
committed
docs: adapter teasers
1 parent cca1bbf commit 0658f3f

File tree

6 files changed

+83
-1
lines changed

6 files changed

+83
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Hooks for fetching, caching and updating asynchronous data in React
2828

2929
Enjoy this library? Try the entire [TanStack](https://tanstack.com)! [React Table](https://github.com/tannerlinsley/react-table), [React Form](https://github.com/tannerlinsley/react-form), [React Charts](https://github.com/tannerlinsley/react-charts)
3030

31-
## Visit [tanstack.com/query](https://tanstack.com/uery) for docs, guides, API and more!
31+
## Visit [tanstack.com/query](https://tanstack.com/query) for docs, guides, API and more!
3232

3333
Still on **React Query v2**? No problem! Check out the v2 docs here: https://react-query-v2.tanstack.com/. <br />
3434
Would you like to try **React Query v4beta**? Check out the v4 beta docs here: https://react-query-beta.tanstack.com/.

docs/adapters/react-query.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
title: React Query
3+
---
4+
5+
The `react-query` package offers a 1st-class API for using TanStack Query via React. However, all of the primitives you receive from these hooks are core APIs that are shared across all of the TanStack Adapters including the Query Client, query results, query subscriptions, etc.
6+
7+
## Example
8+
9+
```tsx
10+
import { QueryClient, useQuery } from 'react-query'
11+
12+
const queryClient = new QueryClient()
13+
14+
function Example() {
15+
const query = useQuery('todos', fetchTodos)
16+
17+
return (
18+
<div>
19+
{query.isLoading
20+
? 'Loading...'
21+
: query.isError
22+
? 'Error!'
23+
: query.data
24+
? query.data.map((todo) => <div key={todo.id}>{todo.title}</div>)
25+
: null}
26+
</div>
27+
)
28+
}
29+
30+
function App () {
31+
return (
32+
<QueryClientProvider value={queryClient}>
33+
<Example />
34+
</QueryClientProvider>
35+
)
36+
}
37+
```

docs/adapters/solid-query.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
title: Solid Query (Coming Soon)
3+
---
4+
5+
6+
> ⚠️ This module has not yet been developed. It requires an adapter similar to `react-query` to work. We estimate the amount of code to do this is low-to-moderate, but does require familiarity with the SolidJS framework. If you would like to contribute this adapter, please open a PR!
7+
8+
The `@tanstack/solid-query` package offers a 1st-class API for using TanStack Query via Solid. However, all of the primitives you receive from this API are core APIs that are shared across all of the TanStack Adapters including the Query Client, query results, query subscriptions, etc.
9+
10+

docs/adapters/svelte-query.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: Svelte Query (Coming Soon)
3+
---
4+
5+
> ⚠️ This module has not yet been developed. It requires an adapter similar to `react-query` to work. We estimate the amount of code to do this is low-to-moderate, but does require familiarity with the Svelte framework. If you would like to contribute this adapter, please open a PR!
6+
7+
The `@tanstack/svelte-query` package offers a 1st-class API for using TanStack Query via Svelte. However, all of the primitives you receive from this API are core APIs that are shared across all of the TanStack Adapters including the Query Client, query results, query subscriptions, etc.

docs/adapters/vue-query.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: Solid Query (Coming Soon)
3+
---
4+
5+
> ⚠️ This module has not yet been developed. It requires an adapter similar to `react-query` to work. We estimate the amount of code to do this is low-to-moderate, but does require familiarity with the Vue framework. If you would like to contribute this adapter, please open a PR!
6+
7+
The `@tanstack/vue-query` package offers a 1st-class API for using TanStack Query via Solid. However, all of the primitives you receive from this API are core APIs that are shared across all of the TanStack Adapters including the Query Client, query results, query subscriptions, etc.

docs/config.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,27 @@
4646
}
4747
]
4848
},
49+
{
50+
"label": "Adapters",
51+
"children": [
52+
{
53+
"label": "React Query",
54+
"to": "adapters/react-query"
55+
},
56+
{
57+
"label": "Solid Query (Coming Soon)",
58+
"to": "#"
59+
},
60+
{
61+
"label": "Vue Query (Coming Soon)",
62+
"to": "#"
63+
},
64+
{
65+
"label": "Svelte Query (Coming Soon)",
66+
"to": "#"
67+
}
68+
]
69+
},
4970
{
5071
"label": "Guides & Concepts",
5172
"children": [

0 commit comments

Comments
 (0)