Skip to content

Instantly share code, notes, and snippets.

@stephenway
Created December 29, 2015 18:01
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 stephenway/18b7e296ca265fbfacd3 to your computer and use it in GitHub Desktop.
Save stephenway/18b7e296ca265fbfacd3 to your computer and use it in GitHub Desktop.
On click, add this class to my object
(ns projectName.core
(:require
goog.object
[om.next :as om :refer-macros [defui]]
[om.dom :as dom]
[untangled.dom :as udom]
))
(defui Root
Object
(initLocalState [this]
{:show-style-class false})
(render [this]
(println (om.next/get-state this))
(dom/div #js {:className (udom/toggle-class (om/get-state this)
:show-style-class "normal classes"
:when-false ""
:when-true "your-fancy-class")
:onClick #(om/update-state! this update :show-style-class not )})))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment