Strictly Typed Object Keys in TypeScript
Want to type a data object so that a given key (e.g. "foo") can only be paired with a specific type (e.g. Bar)? Now you can!
Want to type a data object so that a given key (e.g. "foo") can only be paired with a specific type (e.g. Bar)? Now you can!
Theo has some really interesting videos, but the more I dig into the archive the more I find little gems like this. It's the definition of a quick tip, and it helps explain Maps and Sets in […]