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

Function fetchPosts

e2e/solid-router/basic/src/posts.ts:13–18  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers 1

main.tsxFile · 0.90

Calls 3

infoMethod · 0.65
thenMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected