I am trying to figure out when we need to cancel the cursor to get its value.
The om cursors wiki says that event handlers are not considered part of the visualization phase, so the cursors in the handlers must be corrupted. The 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, handlers (onclick, onchange ...) use the cursor without separating it:
(dom/button #js {:className "destroy" :onClick (fn [_] (put! comm [:destroy todo]))}))
So what is the correct way?
Thanks.
source share