News for hackers. Stuff that matters.
Re:TypeScript is terrible for library developers by valcron1000 on Tuesday August 23, 2022 @08:06PM (#32573329)
> being flexible in what you accept when possible

I disagree with this. When working with rxjs I wanted to emit a single string in an error handler. Since strings are iterable I ended up with the characters being emitted.

The library authors added this "flexibility" (implicit conversion from values to observables) which caused a subtle bug that took me a while to figure out. A type error (expected observable, got string) would have prevented this.

There are no comments on this comment yet.