I don't see any reason to build hidden components, the parent should have all the data it needs to determine what gets built (your second idea). Remounting a component will re-intialize the owner state, but I find that a good argument for maintaining a data representation for state-full components.
On Monday, July 14, 2014 10:21:26 PM UTC-4, Andrew Stoeckley wrote: > A little question that is perhaps more a matter of taste and style, though > maybe there are other considerations I haven't thought about. > > If you have a page with many independent Om components, each of which may or > may not be displayed (mounted) depending on state, it seems to me there are 2 > decent approaches for deciding if they are onscreen. > > One is to just list them all, calling om/build, inside a main root parent. > Then, each component would have its own test (if, when, etc) as to whether it > should be onscreen. > > Alternately, the tests could be done in the main root, and om/build is called > only if the component should be onscreen, thus each component just puts > itself onscreen when it is called. > > This seems a minor distinction to me, but I suspect there would be other > factors that could influence this design and seek any advice. -- 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.
