RSSAmplifier

Daniel Barta · May 9, 2022

TypeScript's Literal Types Are Better Than Enums

0
Sign in to vote or save

This site does not allow itself to be embedded. You can still read it on the original site — the toolbar below keeps your place in the directory.

Combining the descriptive qualities of enumerated types and the easy-to-use nature of strings. During a code review, something that sticks out when the code is full of ad-hoc string checking. For example, implementing a blog engine with three types of roles can start with a check if the user is

Read on danielbarta.com

Comments

Nothing yet. Say the first thing.

    Sign in to join the conversation.