4 ms·
TypeScript or Flow for that matter sucks at using functional style with immutable data types. There are ESLint plugins that allows to enforce immutability with
by fpoling 5y ago
TypeScript or Flow for that matter sucks at using functional style with immutable data types. There are ESLint plugins that allows to enforce immutability with plain JS objects, but still lack of syntactic sugar or union types makes the experience much worse then in functional languages.
- RobertKerans 5y agohttps://github.com/tc39/proposal-record-tuple https://github.com/tc39/proposal-record-tuple Only stage 2, so whether it'll get through to next stage is up in the air, will depend on interest (compare to Temporal which started fairly slow but has gained huge momentum recently and is now at stage 3 and engine testing level) but it's encouraging.
- johnday 5y agoPerhaps what we need is a dialect which compiles to typescript and supports (or better, enforces) the immutability you suggest.