                time-speed)]
     c))
 
+;; Update timer 
 (go (while true
       (<! timer-chan)
       (when-not (apply expired? (get-state :stime :etime))
         (set-state! :etime (dec-time (get-state :etime))))))
 
-
+;; put! to end-chan when timer ends
 (add-watch state :end
            (fn [k r os ns]
              (when (and (get-state :on?) (apply expired? (get-state :stime :etime)))

    (:five presets)
    (:twenty-five presets)))

(defn pomodoro? [five twenty-five]
  (and (= (presets :twenty-five) twenty-five)
       (= (presets :five) five)))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Timer logic
(def ^:constant time-speed 1)

(def timer-chan
  (let [c (chan)

;; Constants

(def ^:constant one-min (* 1e3 60))
(comment (def ^:constant presets {:five (* one-min 5)
                                  :twenty-five (* one-min 25)}))
(def ^:constant presets {:five 1e3
                         :twenty-five (* 1e3 2)})

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Compatability
