Skip to content

Instantly share code, notes, and snippets.

@curtiswilkinson
Last active January 11, 2018 19:44
Show Gist options
  • Save curtiswilkinson/6e6bbdeb93e41784289c4db208b44d7e to your computer and use it in GitHub Desktop.
Save curtiswilkinson/6e6bbdeb93e41784289c4db208b44d7e to your computer and use it in GitHub Desktop.
Interface using pick
interface Task {
id: string,
name: string,
assignee: string,
contacts: any[], //for brevity
associatedJob: string,
submissionDate: string,
allocatedTime: number,
expectedCompletion: string,
invoiceNumber: string,
invoiceDueDate: string,
comment: string,
taskAddress: string
...
... x 10
}
type PartialTast = Pick<Task, 'id' | 'name' | 'contacts'>
@michaelsanford
Copy link

michaelsanford commented Jan 11, 2018

s/PartialTast/PartialTask/g ?

(PS Great article in which this is used; helped me - finally - follow how Pick works.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment