Here's some sample code that I tried to do, following this Github Issue:
https://github.com/swannodette/om/issues/302
(ns map-cursor-test.core
(:require [om.core :as om :include-macros true]
[om.dom :as dom :include-macros true]))
(def app-state (atom {:counts {"jim" 2 "joe" 5 "jack" 1}}))
(enable-console-print!)
(defn item-view [item]
(om/component
(println (type item))
(let [[name value] item]
;; HERE: Cannot transact item because it's not a cursor :(
(dom/h1 #js{:onClick (fn [] (om/transact! item #([name (inc value)]) ))}
(str name " voted " value)))))
(om/root
(fn [app owner]
(om/component
(apply dom/div nil
(om/build-all item-view (:counts app))
)))
app-state
{:target (. js/document (getElementById "app"))})
--
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.