Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Those hacks work but in practice I wouldn't classify them as "good". You end up having to look at a ton of types including in library code like React and etc that can be quite complex. Having to stop and try to wrap those on the fly is terrible ergonomics.


You might also be able to leverage typeof in conjunction with Id<T>. Like if you have some parameter x with a complex type you can create a temporary variable of type Id<typeof x> to avoid looking up any additional types. Totally agree it should be supported out of the box, however.




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

Search: