Skip to content

Commit

Permalink
track down hashing bug
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Granger <ibdknox@gmail.com>
  • Loading branch information
ibdknox committed Sep 8, 2012
1 parent 2c7abbe commit 8652cc9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/crate/binding.cljs
Expand Up @@ -41,8 +41,12 @@
(add-watch atm k
(fn [_ _ ov nv]
(let [latest (get-in nv path)
prev (get-in ov path)
latest-hash (hash latest)]
(when-not (= (.-prevhash sa) latest-hash)
(when (and (not= (.-prevhash sa) latest-hash)
;;TODO: How is it possible that the hashes are different
;;when the items are the same? This seems like a CLJS bug.
(not= prev latest))
(set! (.-prevhash sa) latest-hash)
(-notify-watches sa (get-in ov path) latest)))))
sa)))
Expand Down

0 comments on commit 8652cc9

Please sign in to comment.