News for hackers. Stuff that matters.
Re:Bad TypeScript Habits by bengalister on Tuesday February 02, 2021 @05:46PM (#26008080)
According to https://github.com/microsoft/TypeScript/wiki/Performance#pre... using union types in your example vs interfaces like #6 is bad for compilation performance.
Re:Bad TypeScript Habits by bryzio on Wednesday February 03, 2021 @05:16AM (#26012292)
As the docs mention, the effect is only material when there's a non-trivial number of union elements. For unions containing only a handful of elements the effect is inconsequential.