Ok I agree that om.core/read is a bear now that I'm working on the Om tutorial.
Here's are my current thoughts for 0.3.0: a) cursor can always be read directly during the render phase b) outside the render phase you can only update the application state or `cljs.core/deref` cursors and you will get back a *value* not a cursor c) eliminate om.core/read I think this is a pretty big simplification and much easier to explain while still delivering some good properties with respect to highly concurrent client side applications. Thoughts? David On Mon, Jan 20, 2014 at 6:20 PM, kovas boguta <[email protected]>wrote: > I'm having a hard time using read. > > I find myself using it in 2 places: > > 1. Inside the event handler, I want to read, optionally do something > with the value (typically assoc/dissoc), and put it on a channel. > > 2. Inside a go block initialized during will-mount, same story. > > The problem is that I do a read, pass the value along, and then when > the other end of the channel wants to do an operation, I get the > "Cannot manipulate cursor outside of render phase" error. > > If I turn the value into a string before putting it on the channel, I > don't get the error. > > Is this a laziness issue? A bug, or desired behavior? In any case, I > find it confusing. > > Now, here is a leading question: What is the difference between a > cursor and a reference type? > > Instead of having both (value x) and (read x f), why not just @x? > > As this question suggests, I also don't understand why both value and > read are necessary. > > -- > 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.
