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

Function getPostById

examples/react/https/src/index.tsx:77–82  ·  view source on GitHub ↗
(id: number)

Source from the content-addressed store, hash-verified

75}
76
77const getPostById = async (id: number): Promise<Post> => {
78 const response = await fetch(
79 `https://jsonplaceholder.typicode.com/posts/${id}`,
80 )
81 return await response.json()
82}
83
84function usePost(postId: number) {
85 return useQuery({

Callers 1

usePostFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected