Satisfies is something that was added recently very recently the type script actually. When you create a type with like that you generally create what's called a record in TypeScript where you say record You pass it two things you pass it. What's the key string and what is the value? Generally string number Boolean or any or something like that So when you create atype like thatyou sort of give up all the IntelliSense and all the typing in it. Yeah pretty handy next step Let's talk about let's talk about the problem that we have with Right now in Type Script.
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