A quick example of how TypeScript can be used to your will. I was creating all the types for like a customer purchase and one of the keys in a customer purchase is Which course code it is right? WTF is what the flex box a or G is advanced React and Graph QL No, de note is the node course You get the point right and I was like well Do I need to make I'm adding courses all the time and it would suck if I have to when I launch a new course If I have to go into six or seven files and update it.
In this Hasty Treat, Scott and Wes talk about Satisfies and as const.
Show Notes
export const currencies = { USD: 'US Dollars', CAD: 'Canadian Dollar', EUR: 'Euro', } as const; export type Currency = typeof currencies; export type CurrencyCode = keyof Currency;
Tweet us your tasty treats