3 ms·
Kinda like that. Simple example: Lets say you can submit one of these payloads { type: 'SET_PERSON', payload: Person } and { type: 'SET_AGE', payload: number
by NaughtyShiba 5y ago
Kinda 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.