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

Function fetchPosts

examples/solid/basic-solid-query/src/posts.ts:12–18  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10}
11
12const fetchPosts = async () => {
13 console.info('Fetching posts...')
14 await new Promise((r) => setTimeout(r, 500))
15 return axios
16 .get<Array<PostType>>('https://jsonplaceholder.typicode.com/posts')
17 .then((r) => r.data.slice(0, 10))
18}
19
20const fetchPost = async (postId: string) => {
21 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