Skip to content

Instantly share code, notes, and snippets.

@minikomi
Last active August 29, 2015 14:05
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 minikomi/754d0a2defb8dc7f435b to your computer and use it in GitHub Desktop.
Save minikomi/754d0a2defb8dc7f435b to your computer and use it in GitHub Desktop.
Om basic tutorial -
;; 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