Union types to solve magic strings problems

With the union types of typescript you are solving the problems of magic strings ? Or it's better to make an object?
3 Replies
Sybatron
Sybatron2y ago
You can have fixed values for certain attribute with union type Or just have different attributes based on fixed value (identifier)
bruno!
bruno!2y ago
I found union types usually less annoying and less "boilerplate-like"
akerbeltz
akerbeltzOP2y ago
yep but what option in my question es better? i think the same but maybe i'm missing something else
Want results from more Discord servers?
Add your server