Pure functions
In this section, we come back to the pure functions that we have already learned, but now from a different perspective. Do you remember that Redux tries to be as explicit as possible? There is a reason for that. Everything that is implicit is usually the root cause of troubles. Do you remember functions from math classes? Those are 100% explicit. There is nothing else happening other than transforming the input into some output.
In JavaScript, however, function can have implicit output. It may change a value, change an external system, and many many other things may happen outside of the function scope. You have already learned that in Chapter 5, Store Patterns. All such implicit output is usually referred to as side effects. ...
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