Create a Type with Some Fields of Another Type in TypeScript with Pick

Share this video with your friends

Send Tweet

There might be cases where you have selective data for your entities. Let's say that you are building a public API endpoint to get all the registered users from your users collection. Now there might be sensitive data in your User entity type that you may not want to return in the response. In such cases, Pick can help you be selective and get only the properties you need.

In this lesson, we will learn how to extract properties from a type and create a new type from it.

vamsg007
vamsg007
~ a year ago

Hi! Nice videos. is the closed captions feature broken or not available on this series?