I'm trying to understand when we must deref a cursor to get its value.
In the om cursors wiki it states that event handlers are considered not part of the render phase, and therefore cursors in handlers should be drefed. Same is shown in the Basic-tutorial:
(defn contact-view [contact owner]
(reify
om/IRenderState
(render-state [this {:keys [delete]}]
(dom/li nil
(dom/span nil (display-name contact))
(dom/button #js {:onClick (fn [e] (put! delete @contact))} "Delete")))))
But, in the TodoMVC code, the handlers (onclick, onchange...) use the cursor without derefing it:
(dom/button
#js {:className "destroy"
:onClick (fn [_] (put! comm [:destroy todo]))}))
So, what is the correct way?
Thank you.