Tech. Support Desk : Call. 08045889335 (9AM ~ 6PM)
Cart.0
menu
cart0 my room

function isAddAction(action: CounterAction): action is AddAction return action.type === 'add';

He starts with plain JavaScript Redux to show the fragility: one typo in an action type string ( 'FETCH_USERS' vs 'FETCH-USER' ) breaks your entire app silently. Then, he refactors. interface Action type: string; payload?: any;

Enter .

He explains: " T is a placeholder. When you say new HoldAnything<string>() , you are handing TypeScript a slice of 'string pie'. TypeScript then replaces every T with string before your code runs."

typescript stephen grider