No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
resources
src/something_fun_cljs/service
ui-src/something_fun_cljs/ui
.gitignore
README.md
figwheel_server.log
project.clj

README.md

Something Fun with Clojure-Script

This repo has the results of our group dojo hack-around as part of the uSwitch Clojure Dojo held on 11/01/2016.

The project is based on a lein template provided by @jarohen. The base project can be regenerated by running lein new bounce-webapp [your-project-name]

Usage

To start the project running simply run the following:

    lein dev

This will download the project dependencies, start a repl server on port 7888 and a figwheel server on localhost:3449. The server can be reached on localhost:3000.

You can connect to the running repl by running lein repl ::connect 7888 from the terminal.

Reload everything in the project by running (bounce.core/reload!) from the repl. From here you can connect to a clojure-script repl by running (bounce.figwheel/cljs-repl (bounce.core/ask :cljs-compiler)) from the repl.

Once connected to the clojure-script repl you can run code and see the impact in the browser. Examples are as follows:

  • (swap! (bounce.core/ask :!app) update :my-counter inc) -> Increment the :my-counter value
  • (set! (.-backgroundColor js/document.body.style) "green") -> Change the page background to :green

Components

There are three components on display as part of this wonderful feat of engineering.

  • Button counter -> simple button to increment a counter on the page.
  • Basic palindrome checker -> Check if the input string is a valid palindrome. Update a result string text & colour based on the result (true/false)
  • Rest thingy -> Send a value to the server and then render the response on the page.