File size: 297 Bytes
a8b3f00
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
export type User = {
  id: string
  firstName: string
  lastName: string
  name: string
  phone: string
  username: string
  email: string
  avatar: string
}

export type UserResponse = {
  users: User[]
}

export const fetchUsers = (url: string) =>
  fetch(url).then<UserResponse>(r => r.json())