Embracing Re-Frame
In Managing State with Re-Frame, we introduced re-frame at a glance, but we didn’t really go into detail. Now that we have our environment set up, let’s take a closer look at re-frame and why we chose it.
At its core, re-frame only does two things. It defines our view using layers of pure functions (that is, subscriptions), and it defines state transitions as data (events) to be handled using pure functions (event handlers). Re-frame provides plenty of useful features on top of these two things, but fundamentally re-frame just queries and updates state.
Let’s take a look at how re-frame handles views first, then we’ll look at state transitions afterward. We’ll have to move some of our logic into re-frame events, but we ...
Get Web Development with Clojure, 3rd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.