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

Function usePosts

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

Source from the content-addressed store, hash-verified

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

Callers 1

PostsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected