Summary
In this chapter, we looked at two different approaches (used by commonly available immutability libraries) to avoiding side effects by working with immutable objects and data structures: one based on using JavaScript's object freezing plus some special logic for cloning, and the other based on applying the concept of persistent data structures with methods that allow all kinds of updates without changing the original or requiring full cloning.
In Chapter 11, Implementing Design Patterns – The Functional Way, we will focus on a question that's often asked by object-oriented programmers: how are design patterns used in FP? Are they required, available, or usable? Are they still practiced but with a new focus on functions rather than ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access