I know this is a different direction than a lot of people but I store everything in the app-state and so far it has worked well. There are a hundred reasons why this (storing everything in app-state) is a terrible idea, but I haven't run into any of them.
The main driver for this was for bug reporting - we post the app-state back to the server on errors. We (can) also use web-sockets so I can mirror locally what somebody else is doing. For business reasons this is very important. I should say that I have deliberately architected the UI so it is dumb and the backend has very optimised views per page (we are using DDD, event sourcing and CQRS to complete the buzzward bingo card). I am still storing some de-normalised data in app-state, like reference-data etc., but maybe I have dodged some bullets by having the data the UI receives pre-formatted for the UI (which also makes sense to me for a number of reasons). If you did want to store component-local state then channels or a simple cb would suffice. I would go with a callback in this case as it seems to be a pure implementation detail of the 'layout' component. If the children of the layout are external to the layout (i.e. the layout component is a generic reusable thing) then can you now simply put the logic in the IDidMount of the container and then query the dom itself for all children of that container? On 6 March 2015 at 08:54, Daniel Kersten <dkers...@gmail.com> wrote: > I've successfully used component local state for similar tasks while working > with DimpleJS charts. > > > On Fri, 6 Mar 2015 05:46 Tom Lynch <tfly...@gmail.com> wrote: >> >> One workable possibility: >> >> * init a core.async channel in the container >> * pass the channel from the container into each child component at build >> time using :opts or :state >> * send the discovered size of each child component, with identifying data, >> as a channel message during IDidMount >> >> I don't find these sorts of solutions terribly elegant but it would be >> usable I think. >> >> >> Tom >> >> >> On Friday, 6 March 2015 12:42:12 UTC+8, James Reeves wrote: >>> >>> I've been writing an application using Om, and I've come across a problem >>> I haven't been able to find a good solution for. I'd be grateful for any >>> ideas people might have on how to proceed. >>> >>> In a nutshell, I have a bunch of elements that need to be arranged >>> according to a specific algorithm. They cannot overlap, so I need to know >>> the sizes of all the elements in order to arrange them. >>> >> -- >> You received this message because you are subscribed to the Google >> Groups "Clojure" group. >> To post to this group, send email to clojure@googlegroups.com >> Note that posts from new members are moderated - please be patient with >> your first post. >> To unsubscribe from this group, send email to >> clojure+unsubscr...@googlegroups.com >> For more options, visit this group at >> http://groups.google.com/group/clojure?hl=en >> --- >> You received this message because you are subscribed to the Google Groups >> "Clojure" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to clojure+unsubscr...@googlegroups.com. >> For more options, visit https://groups.google.com/d/optout. > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with your > first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en > --- > You received this message because you are subscribed to the Google Groups > "Clojure" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to clojure+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.