MCPcopy Create free account
hub / github.com/TanStack/router / postsQueryOptions

Function postsQueryOptions

e2e/solid-start/basic-solid-query/src/utils/posts.tsx:10–20  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

8}
9
10export const postsQueryOptions = () =>
11 queryOptions({
12 queryKey: ['posts'],
13 queryFn: async () => {
14 console.info('Fetching posts...')
15 await new Promise((r) => setTimeout(r, 500))
16 return axios
17 .get<Array<PostType>>('https://jsonplaceholder.typicode.com/posts')
18 .then((r) => r.data.slice(0, 10))
19 },
20 })
21
22export const postQueryOptions = (postId: string) =>
23 queryOptions({

Callers 2

posts.tsxFile · 0.90
PostsComponentFunction · 0.90

Calls 3

infoMethod · 0.65
thenMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected