Re: [ClojureScript] [Om] TodoMVC question

2014-09-09 Thread Daniel Kersten
You can put seqs in IFF you don't rely on them being cursors later. I find it easier and safer to make sure they're always cursors. A place this has caught me out is transferring seqs over Websocket and putting them in app state. Now I always call vec (or use mapv or other alternatives as

Re: [ClojureScript] [Om] TodoMVC question

2014-09-08 Thread David Nolen
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 stephan.beh...@gmail.com wrote: Hey there, I'm trying to understand this bit from the Om TodoMVC app: (defn toggle-all [e state] (let

Re: [ClojureScript] [Om] TodoMVC question

2014-09-08 Thread stephanos
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?

Re: [ClojureScript] [Om] TodoMVC question

2014-09-08 Thread David Nolen
On Mon, Sep 8, 2014 at 4:55 PM, stephanos stephan.beh...@gmail.com wrote: 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

Re: [ClojureScript] [Om] TodoMVC question

2014-09-08 Thread stephanos
David, thanks for the clarification! I'm currently writing a blog series for complete LISP + CLJS + Om newbies (like me, obviously) based on the TodoMVC example. So I need to understand it first before I can explain it ... long way to go :) Stephan On Monday, September 8, 2014 11:08:08 PM