3 ms·
According to https://github.com/microsoft/TypeScript/wiki/Performance#preferring-base-types-over-unions https://github.com/microsoft/TypeScript/wiki/Performance
by bengalister 6y ago
According to https://github.com/microsoft/TypeScript/wiki/Performance#preferring-base-types-over-unions https://github.com/microsoft/TypeScript/wiki/Performance#pre...
using union types in your example vs interfaces like #6 is bad for compilation performance.
- bryzio 6y agoAs 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.