Last active
August 29, 2015 14:05
-
-
Save minikomi/754d0a2defb8dc7f435b to your computer and use it in GitHub Desktop.
Om basic tutorial -
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
;; Editing a class name and making it blank results in the following error: | |
;; Uncaught Error: No protocol method ITransact.-transact! defined for type string: | |
; I changed: | |
(defn handle-change [e text owner] | |
(om/transact! text (fn [_] (.. e -target -value)))) | |
; to: | |
(defn handle-change [e text owner] | |
(let [value (.. e -target -value)] | |
(if (empty? value) | |
(om/transact! text (fn [_] (js/String. ""))) | |
(om/transact! text (fn [_] value))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment