Created
December 29, 2015 18:01
-
-
Save stephenway/18b7e296ca265fbfacd3 to your computer and use it in GitHub Desktop.
On click, add this class to my object
This file contains hidden or 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
(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