O'Reilly logo

Clojure Applied by Alex Miller, Ben Vandgrift

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required