Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

inherit with filter typescript

interface UserProfileResponse {
  id: number;
  name: string;
  email: string;
  phone: string;
  avatar: string;
}

interface LoginResponse {
  id: number;
  name: string;
}
// instead of you can pick!
type LoginResponse = Pick<UserProfileResponse, "id" | "name">;
Source by dev.to #
 
PREVIOUS NEXT
Tagged: #inherit #filter #typescript
ADD COMMENT
Topic
Name
4+1 =