 ;; :deregister-event-handler
 ;;
 ;; removes a previously registered event handler. Expects either a single id (
-;; typically a keyword), or a seq of ids.
+;; typically a namespaced keyword), or a seq of ids.
 ;;
 ;; usage:
 ;;   {:deregister-event-handler :my-id)}

;; -- Interceptor -------------------------------------------------------------

(def do-fx
  "An interceptor which actions a `context's` (side) `:effects`.

  For each key in the `:effects` map, call the `effects handler` previously
  registered using `reg-fx`.

  So, if `:effects` was:
      {:dispatch  [:hello 42]
       :db        {...}
       :undo      \"set flag\"}
  call the registered effects handlers for each of the map's keys:
  `:dispatch`, `:undo` and `:db`."
  (->interceptor
    :id :do-fx
    :after (fn do-fx-after
             [context]
             (doseq [[effect-k value] (:effects context)]
               (if-let [effect-fn (get-handler kind effect-k true)]
                 (effect-fn value))))))

;; -- Builtin Effect Handlers  ------------------------------------------------



;; :db
;;
;; reset! app-db with a new value. `value` is expected to be a map.
;;
;; usage:
;;   {:db  {:key1 value1 key2 value2}}
