MCPcopy
hub / github.com/TanStack/query / createPosts

Function createPosts

examples/solid/basic/src/index.tsx:26–34  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

24}
25
26function createPosts() {
27 return useQuery(() => ({
28 queryKey: ['posts'],
29 queryFn: async (): Promise<Array<Post>> => {
30 const response = await fetch('https://jsonplaceholder.typicode.com/posts')
31 return await response.json()
32 },
33 }))
34}
35
36function Posts(props: { setPostId: Setter<number> }) {
37 const state = createPosts()

Callers 1

PostsFunction · 0.70

Calls 1

useQueryFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…