Use this instead of TypeScript Enums

preview_player
Показать описание

Рекомендации по теме
Комментарии
Автор

Holy crap I've been looking for something like this, thank you!

lambmaster
Автор

That’s actually bad that people prefer this over TS Enums. Reason is that when you gonna refactor, all these function calls where you have passed raw scalar strings, numbers, or booleans will not get refactored. TS Enums is the way.

GolderiQ
Автор

I can't think of an use case where I would define my data like this. You don't fetch data from the API? You hardcode it?

anj
Автор

Which vs code extension is that for typescript? 😊

moneyheadlines
Автор

You clicked on weight variable, Pink wrote info on the type. What extension are you using?

ussa
Автор

It's trying to reinvent the wheel for not enough of a good reason.
We use Enum in C# or TS for 1byte level performance purposes not just doing something different.

codeme
Автор

is all that confusion really needed? who uses this kind of stuff in real apps? it's a stupid wankery...

wrends