Put in order · JavaScript and TypeScript course · Module 9: Design Patterns and Architecture
Steps to Implement Immutable State
Arrange the steps for implementing immutable state:
Items to put in order
- Return a new state object
- Freeze the state (Object.freeze)
- Create a reducer function
- Define the initial state
- Propagate changes to subscribers
You can check the correct answer by solving this task in the CodeWorlds game.