Why have I spent six pages talking about JavaScript and React in a Clojure book? I promise I'm not trying to waste your precious time; we simply needed some context to understand what's to come.
Om[4] is a ClojureScript interface to React.js that was developed by the prolific and amazing individual, David Nolen, from Cognitect. Yes, he has also developed core.logic, core.match, and the ClojureScript compiler. That's how prolific. But I digress.
When Facebook released React, David immediately saw the potential and, more importantly, how to take advantage of the assumptions we are able to make when programming in Clojure, the most important of which is that data structures
don't change.
React provides several component life cycle functions that allow developers to control various properties and behaviors. One, in particular, shouldComponentUpdate...