I just found this in the Om wiki: "Everything in the atom should be an associative data structure - either a ClojureScript map or indexed sequential data structure such as a vector."
Isn't it then guaranteed that 'todos' in the transact! update function is always an associative data structure? Or is the use of 'vec' just to 'play it safe'? It seems to work without it in this example. I'm just trying to understand, not nitpick :) On Monday, September 8, 2014 10:48:06 PM UTC+2, David Nolen wrote: > Only associative types are supported as cursors out of the box. Seqs > > are not associative, Vectors are. > > > > David > > > > On Mon, Sep 8, 2014 at 4:44 PM, stephanos <[email protected]> wrote: > > > Hey there, > > > > > > I'm trying to understand this bit from the Om TodoMVC app: > > > > > > (defn toggle-all [e state] > > > (let [checked (.. e -target -checked)] > > > (om/transact! state :todos > > > (fn [todos] (vec (map #(assoc % :completed checked) todos)))))) > > > > > > What I don't understand is: why is the 'vec' function used here? It seems > > to work fine without it. > > > > > > Regards > > > Stephan > > > > > > -- > > > 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.
