Case File: The Reducer
Every screen of an app is a function of its state. Keep all changes in one pure function: the reducer. Make the state read-only, model the actions as a discriminated union, never change the old state, return the very same object when nothing changed, and let the compiler check every action is handled. Real TypeScript in strict mode, generated for you alone.
Case File: The Reducer
Every screen of an app is a function of its state. Keep all changes in one pure function: the reducer. Make the state read-only, model the actions as a discriminated union, never change the old state, return the very same object when nothing changed, and let the compiler check every action is handled. Real TypeScript in strict mode, generated for you alone.
In this lesson:
- typescript
- state-management
- reducer
- immutability
- unions
- frontend
- case-file
This lesson is part of a paid plan
Upgrade to Pro to unlock this course, its labs and its exam.
View Pricing Plans