15. The Frontend: A ClojureScript UI
Activity 15.01: Displaying a Grid of Images from the Internet
Solution:
- At the command-line prompt, create a new Figwheel project using the following Leiningen command:
lein new figwheel packt-clj.images -- --reagent
- Move to the
packt-clj.images/
directory and type:lein figwheel
After a few seconds, your browser should open to the default Figwheel page:
- Open the
src/packt_clj/images/core.cljs
file in your preferred editor and modify the code:(ns packt-clj.images.core     (:require [reagent.core :as r]))
- The commonly used alias for Reagent is
r
instead of Reagent:(defonce app-state (r/atom {:images [] Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â :author-display true...