Browse files

track down hashing bug

Signed-off-by: Chris Granger <>
  • Loading branch information...
1 parent 2c7abbe commit 8652cc951a3dd58ed42241f5f604d72cce1cde49 @ibdknox committed Sep 8, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/crate/binding.cljs
6 src/crate/binding.cljs
@@ -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)))))

0 comments on commit 8652cc9

Please sign in to comment.