-
Notifications
You must be signed in to change notification settings - Fork 55
/
Copy pathuser.ts
53 lines (48 loc) · 1.05 KB
/
user.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
export interface UserState {
users: any[];
loading: boolean;
error: null | string;
}
export enum UserActionTypes {
FETCH_USERS = 'FETCH_USERS',
FETCH_USERS_SUCCESS = 'FETCH_USERS_SUCCESS',
FETCH_USERS_ERROR = 'FETCH_USERS_FETCH_USERS_ERROR',
}
interface FetchUsersAction {
type: UserActionTypes.FETCH_USERS;
}
interface FetchUsersSuccessAction {
type: UserActionTypes.FETCH_USERS_SUCCESS;
payload: any[]
}
interface FetchUsersErrorAction {
type: UserActionTypes.FETCH_USERS_ERROR;
payload: string;
}
export interface UserModel {
id: number;
name: string;
username: string;
email: string;
address: Address;
phone: string;
website: string;
company: Company;
}
interface Address {
street: string;
suite: string;
city: string;
zipcode: string;
geo: Geo;
}
interface Geo {
lat: string;
lng: string;
}
interface Company {
name: string;
catchPhrase: string;
bs: string;
}
export type UserAction = FetchUsersAction | FetchUsersErrorAction | FetchUsersSuccessAction