 ;; -- Interceptor -------------------------------------------------------------
 
 (def do-effects
-  "An interceptor which performs a `context's` (side) `:effects`.
+  "An interceptor which actions a `context's` (side) `:effects`.
 
-  For every key in the `:effects` map, call the handler previously
-  registered via `reg-fx`.
+  For each key in the `:effects` map, call the `effects handler` previously
+  registered using `reg-fx`.
 
   So, if `:effects` was:
       {:dispatch  [:hello 42]

;;
(register
  :dispatch-n
  (fn [val]
    (if-not (sequential? val)
      (console :error "re-frame: ignoring bad :dispatch-n value. Expected a collection, got got: " val))
    (doseq [event val] (router/dispatch event))))


;; :deregister-event-handler
;;
;; removes an event handler. Expects either a single id (typically a keyword), or a seq of ids.
;;
;; usage:
;;   {:deregister-event-handler: :my-id)}
;; or:
;;   {:deregister-event-handler: [:one-id :another-id]}
;;
(register
  :deregister-event-handler
  (fn [val]
    (let [clear-event (partial clear-handlers events/kind)]
      (if (sequential? val)
        (doall (map clear-event val))
        (clear-event val)))))


(register
  :db
  (fn [val]
    (reset! app-db val)))



(register
  :dispatch
  (fn [value]
    (if-not (vector? value)
      (console :error "re-frame: ignoring bad :dispatch value. Expected a vector, but got: " value)
      (router/dispatch value))))


;; :dispatch-n
