Skip to content

Instantly share code, notes, and snippets.

@kourge
Created March 7, 2018 20:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kourge/acdff64803ecc0cd9a780b1a4993f52d to your computer and use it in GitHub Desktop.
Save kourge/acdff64803ecc0cd9a780b1a4993f52d to your computer and use it in GitHub Desktop.
TypeScript: "pick" a subset out of an interface
interface Wide {
x: number;
y: number;
z: number;
}
type Narrow = Pick<Wide, 'x' | 'y'>;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment