Immutability Patterns
Create new objects instead of mutating existing ones. Immutability prevents shared-state bugs, makes code easier to reason about, and enables reliable change detection.
When to Use
- Writing any function that transforms data
- Updating React/Vue/Svelte state
- Working with Redux or other state management
- Reviewing code that modifies objects or arrays in place
- Any time
.push(),.splice(),delete, or direct property assignment appears on shared data
Core
[Description truncada. Veja o README completo no GitHub.]