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

Function fetchPosts

examples/react/nextjs/src/hooks/usePosts.ts:9–13  ·  view source on GitHub ↗
(limit = 10)

Source from the content-addressed store, hash-verified

7}
8
9const fetchPosts = async (limit = 10): Promise<Array<Post>> => {
10 const response = await fetch('https://jsonplaceholder.typicode.com/posts')
11 const data = await response.json()
12 return data.filter((x: Post) => x.id <= limit)
13}
14
15const usePosts = (limit: number) => {
16 return useQuery({

Callers 2

getStaticPropsFunction · 0.90
usePostsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…