Created
May 20, 2016 21:06
-
-
Save alandipert/1d6b10a4fb0457dd8855c819e13635c6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(page "index.html") | |
(defn process [in] | |
(apply str (reverse in))) | |
(def input-str (cell "")) | |
(def processed (cell= (process input-str))) | |
(html | |
(head | |
(link :href "app.css" :rel "stylesheet")) | |
(body | |
(h2 "input") | |
(let [working-input (cell "")] | |
(div | |
(textarea :keyup #(reset! working-input @%) :value working-input) | |
(br) | |
(button :click #(dosync | |
(reset! input-str @working-input) | |
(reset! working-input "")) | |
"Process"))) | |
(h2 "output") | |
(textarea :disabled true processed))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment