DEV Community

Discussion on: The Trouble with TypeScript

Collapse
 
qm3ster profile image
Mihail Malo

I'm concurrently building a backed service in TypeScript and clientside in Svelte.
I didn't bother including TS in the clientside for the non-component files.
I find it extremely helpful, doubly so with RxJS (on the backend), where it has surprisingly good inference.
That is despite the fact that are bugs/rough edges in the typedefs though, for example when you use multicast as one of the adapters in pipe.
It obviously is a subset of JS, and that is partially the point.
You mention type inference (where you mention generics), but I must say it is actually very poor at the moment.

const arr = []
arr.push('🥔')

Oh wow, that's an Array<never>? Good to know.