In Angular apps, the immutability term is mostly mentioned when you deal with the OnPush change detection strategy. Mutable update patterns may not only prevent you from taking advantage of narrowing a components tree subjected to the change detection, but it also leads to hard to spot bugs/gotchas.

With the advent of  Redux, immutable update patterns have become widely popular. In a nutshell, the idea is to create a new object instead of altering the existing one when you need to perform an update action. When it comes to Angular applications, the immutability term is mostly mentioned when you deal with the OnPush change detection strategy in order to improve a runtime performance

However, sticking to mutable update patterns may not only prevent you from taking advantage of narrowing a components tree subjected to the change detection process, but it also leads to some hard to spot bugs/gotchas.

In this blog post, I will cover consequences of not following the recommended approach of using immutable data structures.

#angular #programming

Immutability importance in Angular applications
8.95 GEEK