Skip to content

Commit fba2c86

Browse files
docs: add signal to queryFn for cancelQueries to work properly (#9475)
Co-authored-by: Jonghyeon Ko <[email protected]>
1 parent 6bc45b8 commit fba2c86

File tree

1 file changed

+2
-2
lines changed
  • examples/react/optimistic-updates-cache/src/pages

1 file changed

+2
-2
lines changed

examples/react/optimistic-updates-cache/src/pages/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ type Todos = {
2020
ts: number
2121
}
2222

23-
async function fetchTodos(): Promise<Todos> {
24-
const response = await fetch('/api/data')
23+
async function fetchTodos({ signal }: { signal: AbortSignal }): Promise<Todos> {
24+
const response = await fetch('/api/data', { signal })
2525
return await response.json()
2626
}
2727

0 commit comments

Comments
 (0)