I've got a tree of data for app-state. I can conj a new item to a parent's
children, but when the new item renders, it's type is
cljs.core.PersistentArrayMap {meta: null, cnt: 3, arr: Array[6], __hash: null,
cljs$lang$protocol_mask$partition0$: 16647951...}
rather than
om.core.MapCursor {value: cljs.core.PersistentHashMap, state: cljs.core.Atom,
path: cljs.core.PersistentVector, cljs$lang$protocol_mask$partition0$:
2158397195,
I don't see what I'm doing wrong here. Looking at the TodoMVC code, it's quite
similar.
parent is a cursor into the data.
(defn build-new-child [parent-id]
{:_id (sample-data/make-uuid) :parent-id parent-id})
(defn add-new-child-item [parent]
(let [new-child (build-new-child (:_id @parent))]
(om/transact! parent :children (fn [children] (conj children new-child)))))
Cheers,
Jamie
--
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.