News for hackers. Stuff that matters.
Re:TypeScript Features to Avoid by iLoveOncall on Thursday January 20, 2022 @04:28PM (#30015315)
> Enums IMO have no advantage over union types with string literals, e.g. `type Status = 'fulfilled' | 'pending' | 'failed'`.

Well I would say having to not repeat and update your code everywhere when you change or add a possible value is a pretty big advantage.

Re:TypeScript Features to Avoid by resonious on Thursday January 20, 2022 @07:46PM (#30017679)
In my experience, even if I do change an enum value I also want to change the name in code. Having enum { complete = 'finished' is a little weird so I just change it to enum { finished = 'finished' } anyway.
Re:TypeScript Features to Avoid by pjerem on Thursday January 20, 2022 @04:44PM (#30015541)
My IDE does this just fine (WebStorm, btw)
Re:TypeScript Features to Avoid by pvorb on Thursday January 20, 2022 @06:19PM (#30016810)
But the peer who reviews your code will hate it.
Re:TypeScript Features to Avoid by pjerem on Friday January 21, 2022 @02:07AM (#30020166)
No, it was a team choice.
Re:TypeScript Features to Avoid by pvorb on Saturday January 22, 2022 @11:25AM (#30038016)
Ok, that's good.