My code looks like this and works so far:
om/IRender
(render [_]
(dom/div nil
(om/build service-info/component (get-in app-state
[:selected-domain :services]))
(om/build user-list/component (get-in app-state [:selected-domain
:services])))
service-info and user-list are om components defined like this:
(defn component [services owner]
(reify
om/IInitState
(init-state [_]
....
om/IRenderState
(render-state [_ state]
....
The data structure is like this:
services {:name "ssh"
:users [{
:name "ro"
:password "a"}
{
:name "gu"
:password "8"}]
}
{:name "telnet"
:users [{
:name "rot"
:password "ar"}
}
But the user-list component should not know anything about services. Therefore
I would prefer to pass a cursor to user-list that only contains the users and
not the services as I have to do it right now. I know that I could do something
like:
(om/build user-list/component (nth (get-in app-state [:selected-domain
:services]) service-index ))
But this cursor is bound to one service and selecting another service would not
change this cursor.
--
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.