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

query-keys.md

21 lines338 Bytes

import type { Ref } from 'vue'

function useTodos(todoId: Ref<string>) {
  const queryKey = ['todos', todoId]
  return useQuery({
    queryKey,
    queryFn: () => fetchTodoById(todoId.value),
  })
}