()
| 12 | const queryURL = 'https://jsonplaceholder.typicode.com' |
| 13 | |
| 14 | const 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 | |
| 22 | const fetchPost = async (postId: string) => { |
| 23 | console.info(`Fetching post with id ${postId}...`) |