Implementing Components
Now that we’ve looked at components from the perspective of how to call and connect them, we need to look inside to how to implement the functionality behind the API.
Most components will hold some kind of state—the component may allow callers to update this state or invoke functionality that depends on it. The state mechanisms you’ve learned so far (atoms, refs, agents) can be used in many ways, and we’ll consider in particular how to choose the granularity of state.
We must also consider the full component life cycle. A component will be constructed with configuration data and dependencies, and it may need to initialize internal state or connections to external systems. Once a component is constructed, it’s good to ...
Get Clojure Applied 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.