Hasty Treat - TypeScript Utility Types

EPISODE · Aug 9, 2021 · 16 MIN

Hasty Treat - TypeScript Utility Types

from Syntax - Tasty Web Development Treats · host Wes Bos & Scott Tolinski - Full Stack JavaScript Web Developers

In this Hasty Treat, Scott and Wes talk about TypeScript utility types — what they are, why you might use them, why they exist, and more! Linode - Sponsor Whether you’re working on a personal project or managing enterprise infrastructure, you deserve simple, affordable, and accessible cloud computing solutions that allow you to take your project to the next level. Simplify your cloud infrastructure with Linode’s Linux virtual machines and develop, deploy, and scale your modern applications faster and easier. Get started on Linode today with a $100 in free credit for listeners of Syntax. You can find all the details at linode.com/syntax. Linode has 11 global data centers and provides 24/7/365 human support with no tiers or hand-offs regardless of your plan size. In addition to shared and dedicated compute instances, you can use your $100 in credit on S3-compatible object storage, Managed Kubernetes, and more. Visit linode.com/syntax and click on the “Create Free Account” button to get started. LogRocket - Sponsor LogRocket lets you replay what users do on your site, helping you reproduce bugs and fix issues faster. It’s an exception tracker, a session re-player and a performance monitor. Get 14 days free at logrocket.com/syntax. Show Notes 03:35 - Levels of using TypeScript Typing your code Typing your code, but getting a little bit more dynamic using utility types Creating your own utility types! TypeScript is a language in itself Check out type challenges if you want your mind blown: https://github.com/type-challenges/type-challenges/ https://www.typescriptlang.org/docs/handbook/utility-types.html 07:29 - Partial 08:23 - ReadOnly 09:00 - Required 09:33 - Record A record is an object type that is a bit more restrictive Say you want to store podcast details - name, URL, showCount, etc., but only for Syntax and Shoptalk. 10:47 - Omit I find this one handy when I want to create a “Create Item” type, where it has all the item fields except the ID field 11:34 - Pick Given a type, pick these properties 12:39 - Return Types Gives you the type that is returned from a function. Handy if you need to dynamically generate the type based on a passed function. 13:30 - Case These case types are useful for when you are doing template literal types Uppercase Lowercase Capitalize Uncapitalize Tweet us your tasty treats! Scott’s Instagram LevelUpTutorials Instagram Wes’ Instagram Wes’ Twitter Wes’ Facebook Scott’s Twitter Make sure to include @SyntaxFM in your tweets

NOW PLAYING

Hasty Treat - TypeScript Utility Types

0:00 16:44

No transcript for this episode yet

We transcribe on demand. Request one and we'll notify you when it's ready — usually under 10 minutes.

No similar episodes found.

Managing Next Generation Energy Systems Cambridge University Background Stakeholders working with energy systems have to make complex decisions formulated from risk-based assessments about the future. The move towards more renewables in our energy systems complicates matters even further, requiring the development of an integrated power grid and continuous and steady transformation of the UK power system. Network flows must be managed reliably under uncertain demands, uncertain supply, emerging network technologies and possible failures and, further, prices in related markets can be highly volatile. Mathematicians working with engineers and economists, can make significant contributions to address such issues, by helping to develop fit-for-purpose models for next generation energy systems. These interdisciplinary approaches are looking to address a range of associated problems, including modelling, prediction, simulation, control, market and mechanism design and optimisation. This knowledge exchange workshop was part of the four months Res Integrating Nutrition, Psychology and Neuroscience to Measure Infant Development in the UK & Gambia Talk by Dr Sarah Lloyd Fox, Birkbeck College, on infant brain imaging in The Gambia Rise Up Mentor Derek Kempker Welcome to Rise Up Mentor (formerly, Summits of Life), a platform that advocates for lifelong learning and constant improvement in every aspect of life. As someone who’s experienced both the valleys and peaks of life, I understand that while we cannot control all the obstacles that come our way, we do have the power to choose whether we get back up or not. And each time we choose to rise again, we become stronger.But why settle for just getting back up? By consistently striving to become better and wiser, we can reduce our chances of being knocked down in the first place. That’s why I started Rise Up Mentor – to encourage and motivate you to continuously improve in all areas of life, including vocation, marriage, friendship, personal development, health, parenting, lifestyle, spirituality, intellect, and finance.Although I am a Certified Master Life Coach, I don’t consider myself an expert or master, because I don’t feel there is such a thing as mastering life, but it is possible to Kaizen Blueprint Aldo Chandra "Kaizen" is a Japanese term for continuous improvement. This podcast provides a blueprint to learn about health, wealth, relationships and everything else in between. Through our podcast, we strive to inspire, educate, and motivate our audience to cultivate a mindset of lifelong learning, productivity, and personal development. By sharing insights, strategies, and practical tips, we aim to guide listeners on their journey towards realizing their fullest potential, fostering success, and creating lasting positive change.
URL copied to clipboard!