mirror of
https://github.com/lainbo/component-party.git
synced 2026-04-05 04:59:02 +08:00
chore: improve naming
This commit is contained in:
committed by
GitHub
parent
138f2bacc0
commit
d863460fc0
@@ -24,14 +24,14 @@ export class UserService {
|
||||
loadUsers() {
|
||||
this.state.next({ ...initialState, loading: true });
|
||||
|
||||
this.http.get<UserRes>('https://randomuser.me/api/?results=3').subscribe({
|
||||
this.http.get<UserResponse>('https://randomuser.me/api/?results=3').subscribe({
|
||||
next: ({ results }) => this.state.next({ ...initialState, users: results }),
|
||||
error: (error) => this.state.next({ ...initialState, error }),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export interface UserRes {
|
||||
export interface UserResponse {
|
||||
results: User[];
|
||||
info: any;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user