3 ms·
Looks like pattern matching!
by the_gipsy 5y ago
Looks like pattern matching!
- NaughtyShiba 5y agoKinda like that. Simple example: Lets say you can submit one of these payloads { type: 'SET_PERSON', payload: Person } and { type: 'SET_AGE', payload: number } Based on what type field equals to, TLS (Typescript Language Server - used by IDEs) and TSC (TypeScript Compiler) will know type of payload. It’s already possible to achieve that to some extent, but it’s really limited.
- the_gipsy 5y agoI love that TypeScript never stops pushing type safety.