Ah, what I failed to realize is that you can generate a sequence of cursors inline from other cursors. I had previously thought that the cursor sequence must exist in the app state.
On Mon, Aug 4, 2014 at 11:33 PM, Johann Bestowrous <[email protected]> wrote: > You can always use regular maps to build components. Here's an example from > David Nolen that might help: > https://github.com/swannodette/om/blob/master/examples/sortable/src/core.cljs#L259 > > He maps over an id-sequence just like would want. Let me know if you have any > follow up questions. > > > On Monday, August 4, 2014 4:02:12 AM UTC-7, Andrew Stoeckley wrote: >> As Om's build-all takes a sequence of cursors, I'm wondering the best >> practice for when the component function passed to build-all needs to lookup >> its item from the sequence to get more info about it from a different cursor >> in the app-state, i.e. in a relational database type of way: >> >> (defn app-state >> (atom {:attributes {... map of an id to info about that id ...} >> :id-sequence [id1 id5 id4 id7... etc as if based on a sorting >> order or other sequence, perhaps even repeated items]})) >> >> Now suppose I want to call build-all on :id-sequence but then use info from >> :attributes after getting an item from the vector? >> >> One bloated option would be to create a new sequence in the app state that >> holds the id and its attributes, which would mean for repeated ids the same >> attributes are stored multiple times. >> >> Unlike other Om components, I'm guessing build-all is not designed to accept >> multiple cursors since it needs a single sequence to do its thing. >> >> Can anyone advise a good approach? > > -- > Note that posts from new members are moderated - please be patient with your > first post. > --- > You received this message because you are subscribed to a topic in the Google > Groups "ClojureScript" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/clojurescript/O99WL6rrhO4/unsubscribe. > To unsubscribe from this group and all its topics, 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.
