 
   Uses an agent so it's safe to call this from within a transaction."
   [deps key handler]
-  (let [deps (if (coll? deps)
-               (set deps)
-               (set [deps]))]
+  (let [deps (deps->set deps)]
     (send-off dep-state* on-deps* key deps handler)))
 
 (defn satisfy-deps

                     {:satisfied #{}
                      :todo (deps :done)
                      :done []})))

     :done t-done
     :todo t-todo}))

(defn- deps->set
  "Converts deps to a deps-set. Deals with single elements or collections."
  [deps]
  (if (coll? deps)
    (set deps)
    (set [deps])))

(defn on-deps
  "Specify that a function should be called once one or more dependencies
  have been satisfied. The function is run immediately if the deps have
