Skip to content

Instantly share code, notes, and snippets.

@geraldodev
Created November 23, 2013 12:38
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 geraldodev/7614173 to your computer and use it in GitHub Desktop.
Save geraldodev/7614173 to your computer and use it in GitHub Desktop.
(defr LikeButton
[component props state]
:get-initial-state #(identity {:liked true})
[:p {:on-click #(swap! component update-in [:liked] not)}
"You " (if (:liked state) "liked" "not liked") " this. Click to toggle"]
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment