Typescript Stephen Grider ((full)) Link
He draws a "pie". The generic is the slice of pie you pass in.
This is the "aha!" moment of the entire course. You realize that TypeScript is not a linter; it is a . Step 3: The Type Predicate He then writes a custom type guard: typescript stephen grider
When you use if (isAddAction(action)) , TypeScript narrows the type inside the block. Grider calls this "teaching the compiler your business logic." He draws a "pie"
But he doesn't stop at explanation. He builds an entire generic Eventing system for a backend model. You write addEventListener<T>(eventName: T, callback: (data: T) => void) . By the time you finish debugging why your 'user-update' event expects a User object, generics are no longer magic—they are a tool. The centerpiece of Grider's TypeScript course is not a to-do app. It is a type-safe state management library from scratch. You realize that TypeScript is not a linter; it is a
Stephen Grider does not promise you will become a TypeScript contributor to the compiler. He promises you will never again push a bug where undefined is not a function at 2 AM.
He then builds a Sort class using an interface Sortable . He demonstrates how an interface allows a single sorting algorithm to work on LinkedList , NumbersCollection , and CharactersCollection simultaneously. This is where TypeScript clicks for Grider's students: types are not about restricting you; they are about composing you. Generics are the wall that breaks most developers. The syntax <T> looks like line noise. Grider’s solution is visual and tactile.
Grider dances a little jig here (metaphorically). He shows you that inside a reducer, when you check action.type === 'add' , TypeScript automatically knows that action.payload is a number . Not any . Not number | undefined . A number.
