O'Reilly logo

Learning ClojureScript by Allen Rohner, Rafik Naccache, W. David Jarvis

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

Routing and HTML5 history

So, at this point, our todo application has some interesting features, but it's very bare bones. It's also literally a single page application, but, of course, real applications typically involve multiple pages. Let's extend ours to have multiple pages.

We've already included bidi as a dependency of the application, and we've already used it on the server side. Now, we will use it to do client-side routing. Here, routing refers to the process of determining which page to display, based on the contents of the URL. Let's get started.

First, we'll modify project.clj and add [venantius/accountant "0.1.7"] to the :dependencies vector. Then, let's add [accountant.core :as accountant] to the om-tut.core ns declaration:

 (ns om-tut.core ...

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