On Friday, November 28, 2014 9:28:25 AM UTC, David Mohl wrote:
> Hey there. I am constantly running into a small issue with om/update! and 
> om/transact! and look for a point into the right direction.
> 
> This snippet sets the `some-value` state to true. 
> 
> (om/transact! app [:some-value] (fn [_] true))
> 
> The way I understood it from the documentation 
> (https://github.com/swannodette/om/wiki/Documentation#update), I should be 
> able to accomplish the same thing by using the following update statement: 
> 
> (om/update! app [:some-value] true)
> 
> While the `transact!` one works fine, `update!` is always throwing `Uncaught 
> TypeError: Cannot read property 'closure_uid_xxxxxxx' of null`
> 
> I am wondering what I'm doing wrong or where my thinking error is.

update! is simply calling transact! for you just the way you called it 
initially so i don't see how it could be the problem, here is the source:

(defn update!
  "Like transact! but no function provided, instead a replacement
  value is given."
  ([cursor v]
    (transact! cursor [] (fn [_] v) nil))
  ([cursor korks v]
    (transact! cursor korks (fn [_] v) nil))
  ([cursor korks v tag]
    (transact! cursor korks (fn [_] v) tag)))

-- 
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.

Reply via email to