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