In Om, why does transact not update cursor value.

156 views
Skip to first unread message

John Chijioke

unread,
May 25, 2015, 1:05:30 PM5/25/15
to clojur...@googlegroups.com
When a transact has happened to cursor successfully. Why does (om/value cursor) not return the current value in (om/state cursor) at (om/path cursor)?

John.

David Nolen

unread,
May 25, 2015, 2:12:31 PM5/25/15
to clojur...@googlegroups.com
om/value is the cached value that was seen at the start of render which is useful to know. You need to deref if you absolutely need to see what the current value is.

David

On Mon, May 25, 2015 at 1:05 PM, John Chijioke <johnb...@gmail.com> wrote:
When a transact has happened to cursor successfully. Why does (om/value cursor) not return the current value in (om/state cursor) at (om/path cursor)?

John.

--
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 clojurescrip...@googlegroups.com.
To post to this group, send email to clojur...@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.

John Chijioke Umeasiegbu

unread,
May 26, 2015, 4:02:08 AM5/26/15
to David Nolen
Hi David,

Then the name should be more like om/cached-value or om/init-value. It's very misleading as om/value. And I suggest there should be a name for getting the current value as having to do (get-in @(om/state cursor)‎ (om/path cursor) ) is very boring. 
Moreover, I still have not found a great need for om/value as it's currently implemented.

WDYT?

John.
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/Ax3mO6oJFu4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to clojurescrip...@googlegroups.com.

Gary Verhaegen

unread,
May 28, 2015, 7:08:47 AM5/28/15
to clojur...@googlegroups.com
Try @cursor ?

John Chijioke

unread,
May 29, 2015, 9:44:24 AM5/29/15
to clojur...@googlegroups.com
Thanks a lot for that pointer. I really appreciate.

John Chijioke

unread,
May 29, 2015, 1:11:47 PM5/29/15
to clojur...@googlegroups.com
I also didn't understand that was what David meant by "you absolutely need to deref".

Jamie Orchard-Hays

unread,
May 29, 2015, 1:49:31 PM5/29/15
to clojur...@googlegroups.com
In some life-cycle methods you need to deref and others you don't. I found it confusing until I got that straight.

On May 29, 2015, at 1:11 PM, John Chijioke <johnb...@gmail.com> wrote:

> I also didn't understand that was what David meant by "you absolutely need to deref".
>
Reply all
Reply to author
Forward
0 new messages