Toptal
Welcome back for the second exciting installment of Unearthing ClojureScript! In this post, I’m going to cover the next big step for getting serious with ClojureScript: state management—in this case, using React.
With front-end software, state management is a big deal. Out-of-the-box, there are a couple ways to handle state in React:
Keeping state at the top level, and passing it (or handlers for a particular piece of state) down to child components. Throwing purity out of the window and having global variables or some Lovecraftian form of dependency injection.
Generally speaking, neither of these are great. Keeping state at the top level is fairly simple, but then there’s a large amount of overhead to passing down application state to every component that needs it.
By comparison, having global variables (or other naive versions of state) can result in hard-to-trace concurrency issues, leading to components not updating when you expect
To read the full article click on the 'post' link at the top.