Hello,

I'm loving Om but I'm encountering an issue using multiple cursors.  Here's a 
boiled-down version that demos the issue I'm seeing.

(defn log-state
  [state]
  (prn @state))

(defn button
  [state owner]
  (reify
    om/IRender
    (render [this]
      (dom/button #js {:onClick #(log-state state) } "Log"))))

(defn test-app
  [state owner]
  (reify
    om/IRender
    (render [this]
      (dom/div nil
        (om/build button {:x (:a state) :y (:b state)})
        (om/build button state)))))

(om/root test-app (atom {:a [1] :b [2] :c [3]}) {:target (. js/document 
(getElementById "app"))})


Clicking the first button throws a "Cannot manipulate cursor outside of render 
phase, only om.core/transact!, om.core/update!, and cljs.core/deref operations 
allowed" even though I'm derefing it.  The second button logs just fine.

Any advice would be greatly appreciated!

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/clojurescript.

Reply via email to