Skip to content

Commit d723428

Browse files
authored
chore: update readme
add onServerPrefetch
1 parent 0112812 commit d723428

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,14 @@ In a vue component :
5252
const queryClient = useQueryClient()
5353
5454
// Query
55-
const { isLoading, isError, data, error } = useQuery({
55+
const { isLoading, isError, data, suspense, error } = useQuery({
5656
queryKey: ['todos'],
5757
queryFn: () => $fetch("/api/todos"), // Use $fetch with your api routes to get typesafety
5858
})
5959
60+
//Suspense
61+
onServerPrefetch(suspense)
62+
6063
// Mutation
6164
const { mutate } = useMutation({
6265
mutationFn: (newTodo) => $fetch("/api/todos", { method: "POST", body: newTodo })

0 commit comments

Comments
 (0)