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

query-keys.md

21 lines338 Bytes

1---
2id: query-keys
3title: Query Keys
4ref: docs/framework/react/guides/query-keys.md
5---
6​
7[//]: # 'Example5'
8​
9```ts
10import type { Ref } from 'vue'
11​
12function useTodos(todoId: Ref<string>) {
13 const queryKey = ['todos', todoId]
14 return useQuery({
15 queryKey,
16 queryFn: () => fetchTodoById(todoId.value),
17 })
19```
20​
21[//]: # 'Example5'