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

Function fetchPosts

e2e/react-router/basic-react-query/src/posts.ts:14–19  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers 1

posts.tsFile · 0.70

Calls 3

infoMethod · 0.65
thenMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected