Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
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
15
const
usePosts = (limit: number) => {
16
return
useQuery({
17
queryKey: [
'posts'
, limit],
18
queryFn: () => fetchPosts(limit),
19
})
20
}
21
22
export
{ usePosts, fetchPosts }
Callers
1
PostList
Function · 0.90
Calls
2
useQuery
Function · 0.90
fetchPosts
Function · 0.85
Tested by
no test coverage detected