(postId: string)
| 20 | }) |
| 21 | |
| 22 | export const postQueryOptions = (postId: string) => |
| 23 | queryOptions({ |
| 24 | queryKey: ['posts', postId], |
| 25 | queryFn: async () => { |
| 26 | console.info(`Fetching post with id ${postId}...`) |
| 27 | await new Promise((r) => setTimeout(r, 500)) |
| 28 | |
| 29 | return axios |
| 30 | .get<PostType>(`https://jsonplaceholder.typicode.com/posts/${postId}`) |
| 31 | .then((r) => r.data) |
| 32 | }, |
| 33 | }) |
no test coverage detected