MCPcopy Create free account
hub / github.com/TanStack/devtools / usePosts

Function usePosts

examples/react/basic/src/index.tsx:124–132  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

122 )}
123 </div>
124 )
125}
126function usePosts() {
127 return useQuery({
128 queryKey: ['posts'],
129 queryFn: async (): Promise<Array<Post>> => {
130 const response = await fetch('https://jsonplaceholder.typicode.com/posts')
131 return await response.json()
132 },
133 })
134}
135

Callers 1

PostsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected