Om by swannodette is a ClojureScript interface to Facebook’s React. It’s power is that it can create UIs that are easily snapshottable, rewindable, and all with great performance.
Getting to a good starting point with ClojureScript can be a little complicated, so here’s a step-by-step process for going from a clean slate to a working development enviroment.
Presuming leiningen installed, getting a ClojureScript app template is easy.
Just use mihneadb’s ClojureScript template.
1 2 | |
Add Om to the dependencies in project.clj
1 2 3 4 5 | |
Then edit resources/public/index.html and add a div, and React to the <body> element:
1 2 3 4 5 6 7 | |
Now, time for some ClojureScript, edit core.cljs
1 2 3 4 5 6 7 8 9 | |
Last step, let’s get it on the browser:
1 2 | |
Then just open http://localhost:8080/ in your browser, and you’ve got a working Om ClojureScript app running!