(limit = 10)
| 7 | } |
| 8 | |
| 9 | const fetchPosts = async (limit = 10): Promise<Array<Post>> => { |
| 10 | const response = await fetch('https://jsonplaceholder.typicode.com/posts') |
| 11 | const data = await response.json() |
| 12 | return data.filter((x: Post) => x.id <= limit) |
| 13 | } |
| 14 | |
| 15 | const usePosts = (limit: number) => { |
| 16 | return useQuery({ |
no outgoing calls
no test coverage detected
searching dependent graphs…