Hello,

I've been learning Om by building some basic components, and I've run into a 
bit of a problem with generic container components.

I have a splitter component that splits a div vertically or horizontally with a 
draggable bar, and it accepts child components in its :opts map.  I'm currently 
passing :opts that look like this:

:opts {
  :views [{:view #(om/build top-view (:top-data %)) :min-px 200}
          {:view #(om/build bottom-view (:bottom-data %))}]
  :direction :horizontal}


In the splitter's render method, it calls the :view functions with the root app 
cursor as an argument.  This works, but it feels like a hack.  It seems weird 
that the child component has to derive its cursor from the parent cursor, 
which, in this case, really knows nothing about the child.  Is there a better 
way to do this?  I haven't been able to find any examples of generic containers 
written in Om.

Regards,
Russ

-- 
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.

Reply via email to