3 ms·
Start with Figwheel[1] to enable hot-loading code and live reloading: lein new figwheel <app-name> I have used Reagent[2] since I'm only doing prototypes an
by fnordsensei 10y ago
Start with Figwheel[1] to enable hot-loading code and live reloading:
lein new figwheel <app-name>
I have used Reagent[2] since I'm only doing prototypes and don't have to worry about production quality. Om/Om Next[3] seems like it would be worth checking out since it does a bunch of clever things that Reagent doesn't. Reagent is very straightforward and therefore might be the better starting point, seeing as you're just starting out.
Like the sibling comment pointed out, Reagent uses Hiccup-style data structures to represent HTML. Om can be configured to do the same, but doesn't out of the box last time I checked. Either way, the Hiccup syntax looks like this:
[:div [:h1 "Hello world"]]
It's just regular arrays with symbols, strings and what-have-you, meaning you can construct them using standard Clojure functions in any way you see fit.
Add either Reagent or Om to your project.clj, and off you go.
[1]: https://github.com/bhauman/lein-figwheel https://github.com/bhauman/lein-figwheel
[2]: https://github.com/reagent-project/reagent https://github.com/reagent-project/reagent
[3]: https://github.com/omcljs/om https://github.com/omcljs/om