4 ms·
You can only do as much as TS allows you to, unless you route through babel in a second pass. TS is a tool that controls to which extend you can use language fe
by mlsarecmg 10y ago
You can only do as much as TS allows you to, unless you route through babel in a second pass. TS is a tool that controls to which extend you can use language features that are drafted. They do pick drafts here and there, but others they omitt, object spread for instance which is very common for Redux.
As i said, try to transpile this in TS: http://redux.js.org/docs/basics/ExampleTodoList.html http://redux.js.org/docs/basics/ExampleTodoList.html
This is why they made Flow.
- bcherny 10y agoStill not sure I understand. All the code in that link is valid TS - TS is just a superset of JS. Object spread is not part of the ES7 spec. It is a proposal which has not made it to stage 3 yet, and might still be dropped. That said, there is a TS issue tracking adding support for it: https://github.com/Microsoft/TypeScript/issues/2103 https://github.com/Microsoft/TypeScript/issues/2103.