MCPcopy Index your code
hub / github.com/TanStack/query / usePosts

Function usePosts

examples/react/nextjs/src/hooks/usePosts.ts:15–20  ·  view source on GitHub ↗
(limit: number)

Source from the content-addressed store, hash-verified

13}
14
15const usePosts = (limit: number) => {
16 return useQuery({
17 queryKey: ['posts', limit],
18 queryFn: () => fetchPosts(limit),
19 })
20}
21
22export { usePosts, fetchPosts }

Callers 1

PostListFunction · 0.90

Calls 2

useQueryFunction · 0.90
fetchPostsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…