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

Function fetchPosts

examples/react/basic/src/posts.ts:11–17  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9}
10
11export const fetchPosts = async () => {
12 console.info('Fetching posts...')
13 await new Promise((r) => setTimeout(r, 500))
14 return axios
15 .get<Array<PostType>>('https://jsonplaceholder.typicode.com/posts')
16 .then((r) => r.data.slice(0, 10))
17}
18
19export const fetchPost = async (postId: string) => {
20 console.info(`Fetching post with id ${postId}...`)

Callers 6

posts.tsxFile · 0.90
posts.tsxFile · 0.90
posts.tsxFile · 0.90
posts.tsxFile · 0.90
main.tsxFile · 0.90
postsQueryOptionsFunction · 0.50

Calls 3

infoMethod · 0.65
thenMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected