2022-10-26
1656
#typescript
Rahul Chhodde
138499
Oct 26, 2022 ⋅ 5 min read

Evaluating alternatives to TypeScript’s switch case

Rahul Chhodde I'm a software developer with over seven years of experience in different web technologies.

Recent posts:

typescript enums

TypeScript enums: Usage, advantages, and best practices

Learn how TypeScript enums work, the difference between numeric and string enums, and when to use enums vs. other alternatives.

Clara Ekekenta
Mar 14, 2025 ⋅ 7 min read
how to handle react-scripts in a fast-changing React landscape

How to handle react-scripts in a fast-changing React landscape

Review the basics of react-scripts, its functionality, status in the React ecosystem, and alternatives for modern React development.

Ibrahima Ndaw
Mar 13, 2025 ⋅ 9 min read
how to delete local and remote branches in Git

How to delete local and remote branches in Git

Explore the fundamental commands for deleting local and remote branches in Git, and discover more advanced branch management techniques.

Timonwa Akintokun
Mar 13, 2025 ⋅ 7 min read

The complete guide to the AbortController API

Check out a complete guide on how to use the AbortController and AbortSignal APIs in both your backend and frontend.

Joseph Mawa
Mar 12, 2025 ⋅ 9 min read
View all posts

2 Replies to "Evaluating alternatives to TypeScript’s switch case"

  1. I like this approach however I don’t think it is ideal for the example given since you can’t externalize your strings and would need to make a code change to add or change definitions. With switch/case externalizing strings is simple.

    More an issue with the example than the approach though.

  2. I don’t think your approach is incorrect but the example given should probably use externalized stringsto allow new definitions to be added without code changes.

Leave a Reply