Skip to content

Instantly share code, notes, and snippets.

@cgrand
Created January 20, 2014 16:42
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 cgrand/8523669 to your computer and use it in GitHub Desktop.
Save cgrand/8523669 to your computer and use it in GitHub Desktop.
;; without the automatic application/component state split idea prompted by David
(let [t (template
:li (dup :items
:label (content :desc)
checkbox (mash
(attr :checked :done)
(on-click [e item]
(update-in item [:done] not))
; or
#_(scope :done
(on-click [e done]
(not done))))))]
(t {:items [{:desc "Todo #1"
:done false}
{:desc "Todo #2"
:done true}]}))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment