Hacker News new | past | comments | ask | show | jobs | submit login

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.



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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: