       out)))
 
 (defn every
+  "Takes a time interval `ms`. The resulting signal is the current time, updated
+  every `ms` milliseconds."
   [ms]
   (z/input (t/now) [::every ms] (every-channel-fn ms)))
 

      out)))

(defn fps
  [n]
  (z/input 0 [::fps n] (fps-channel-fn n)))

(defn every-channel-fn
  [ms]
  (fn [graph opts]
    (let [out (async/chan)]


#+cljs
(defn debounce
  "Returns a signal which relays the latest value from `sig` only after `ms`
  milliseconds have passed since `sig` last updated. Useful when you want to
  wait until a user stops typing before doing something with the text, for
  example."
  [ms sig]
  (let [timeouts (->> sig (since ms) (z/keep-if not false))]
    (->> sig (z/sample-on timeouts))))
