Skip to content
This repository was archived by the owner on Mar 12, 2024. It is now read-only.

Commit 830617f

Browse files
chore: include turbo query docs
1 parent f25fb4e commit 830617f

File tree

5 files changed

+427
-131
lines changed

5 files changed

+427
-131
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,25 @@ const [post, { isRefetching, refetch, mutate, error }] = useQuery<Post>(
4545
refetch()
4646
```
4747

48+
### Configuration
49+
50+
> **Note**
51+
>
52+
> All options from [Turbo Query](./src/turbo-query/README.md) apply.
53+
54+
```ts
55+
import { configure } from 'vue-unquery'
56+
57+
configure({
58+
async fetcher(key, { signal }) {
59+
const response = await fetch(key, { signal })
60+
if (!response.ok)
61+
throw new Error('Fetch request failed')
62+
return await response.json()
63+
},
64+
})
65+
```
66+
4867
## License
4968

5069
[MIT](./LICENSE) License © 2022-2023 [Johann Schopplich](https://github.com/johannschopplich)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"vue": "^3"
4141
},
4242
"devDependencies": {
43-
"@antfu/eslint-config": "^0.39.1",
43+
"@antfu/eslint-config": "^0.39.3",
4444
"@types/node": "^18.16.14",
4545
"@vitejs/plugin-vue": "^4.2.3",
4646
"bumpp": "^9.1.0",

playground/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import App from './App.vue'
44

55
configure({
66
async fetcher(key, { signal }) {
7-
await new Promise(resolve => setTimeout(resolve, 2000))
7+
// await new Promise(resolve => setTimeout(resolve, 2000))
88
const response = await fetch(key, { signal })
99
if (!response.ok)
1010
throw new Error('Fetch request failed')

0 commit comments

Comments
 (0)