I used a channel in the parent. You pass that to the descendants and write to the channel. The ancestor receives messages via the channel.
On Mar 19, 2015, at 7:53 AM, Wilker <[email protected]> wrote: > Hi, > > I'm creating a component here that will actually render on canvas, to be more > specific I wanna have a tree definition that end's up rendering on Canvas > (kind of the react-canvas project, but on Om, and for other purposes). > > In React is more clear how to write things like this, you can do: > > <Surface> > <Layer> > <Rectangle width="100" height="100" /> > </Layer> > </Surface> > > And on react you have the children props and that stuff that can be use to > "integrate" those components. > > But how do I accomplish a similar thing with Om? > > The farthest that I was able to got was an idea like this: > > (om/build surface > [(om/build layer [(om/build square {:width 100 :height 100}]]) > > This is just an "idea" on how to nest components that I came up, but it's not > really working... > > Ideally I would like for the child node to be able to access the parent in > order to call methods on the canvas (that's on the surface component) to > render things. > > How can I manage this kind of components with Om? > > 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. -- 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.
