Hi.
For example I have this hierarchy:
Guest
Room
Hotel Guest-settings
Root
(defn ui-state []
(om/ref-cursor (:ui-state (om/root-cursor app-state))))
(def app-state atom({:ui-state {:selected nil}
:hotels [{:name "stay4free"
:rooms [{:id 202 :guests
[{:id 123 :name "Poor slob"}]}]}]}))
I can selected a guest by clicking on a guest node.
That will trigger an update! that changes a reference cursor [:ui-state
:selected] to the guest id.
Whenever that happens I want to display some textboxes and sliders to
change information about the guest.
Problem is that I don't have a handy reference to the guest, only an unique
id.
Since guest-settings is going to do something like (om/build guest-settings
(:ui-state app))
I can use the id in :selected to dig down through the hierarchies until I
find the right guest.
Seems like a sub-optimal solution though.
Any tips?
Thanks.
--
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.