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

Function fetchPosts

e2e/solid-router/basic-solid-query/src/posts.ts:14–20  ·  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 await new Promise((r) => setTimeout(r, 500))
17 return axios
18 .get<Array<PostType>>(`${queryURL}/posts`)
19 .then((r) => r.data.slice(0, 10))
20}
21
22const fetchPost = async (postId: string) => {
23 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