Skip to content

Instantly share code, notes, and snippets.

@micha
Last active February 2, 2016 14:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save micha/4536f3ca8c80054e2bbe to your computer and use it in GitHub Desktop.
Save micha/4536f3ca8c80054e2bbe to your computer and use it in GitHub Desktop.
(page "index.html")
(defc composite-data {"A" "Apple" "B" "Boy"})
(defc data-key "A")
(defc= data-value
(get composite-data data-key)
(fn [item] (swap! composite-data assoc @data-key item)))
(html
(head)
(body
(p (text "data: ~{composite-data}"))
(p (text "key: ")
(input
:type "text"
:value data-key
:keyup #(reset! data-key @%)))
(p (text "value: ")
(input
:type "text"
:value data-value
:keyup #(reset! data-value @%)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment