Skip to content
Browse files

clocky: Fixed bind! failure by forcing side effects with doall

The for comprehension is lazy and this prevents the c2 atom
rebindings from working. Wrapping in doall provides the
desired behavior.
  • Loading branch information...
1 parent 6b3b60d commit d83c66074265ff4d624c1c8d18f63b20b68d2409 @wemotom wemotom committed Oct 2, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 clocky/src/cljs/clocky/core.cljs
View
4 clocky/src/cljs/clocky/core.cljs
@@ -15,7 +15,7 @@
(bind! "#clocky"
[:svg
[:g {:transform "translate(300,300)rotate(-90)"}
- (for [k [:hours :minutes :seconds :millis]]
+ (doall (for [k [:hours :minutes :seconds :millis]]
(let [v (get @clock-atom k)
angle1 (/ (* Tau v) 100)
angle2 (+ angle1 Pi)
@@ -29,7 +29,7 @@
[:path {:class (str (name k) "2")
:d (arc :outer-radius radius
:start-angle angle2
- :end-angle angle3)}]]))]])
+ :end-angle angle3)}]])))]])
(defn nextloop []
(let [d (js/Date.)]

0 comments on commit d83c660

Please sign in to comment.
Something went wrong with that request. Please try again.